On Tue, 2025-10-28 at 12:06 +0530, Giriraj Sharma wrote:
> We are running into query planner instability on an append-only table that records daily commit information.
> The workload is heavily skewed toward the current day’s data, and query performance deteriorates periodically until
werun ANALYZE.
The best approach is to run autoanalyze often enough, either by reducing
autovacuum_analyze_scale_factor for the table or (as you suggested) by
setting the parameter to 0 and using only autovacuum_analyze_threshold.
There is no way to force a certain plan in PostgreSQL, unless you are
using the pg_hint_plan extension.
Yours,
Laurenz Albe