Dimitri Fontaine: Plan Advice in PostgreSQL 19
PostgreSQL Planet9h4 min read
There is a conversation that happens in every PostgreSQL shop eventually. A query that has been fine for a year gets slow overnight. Nothing was deployed. The data grew a little, ANALYZE ran, and the planner — entirely reasonably, on the numbers it had — picked a different plan. The old plan was better. You would like it back. PostgreSQL 19 ships two new modules for exactly this: pg_plan_advice , which can read a plan back out as a string and enforce it later, and pg_stash_advice , which keeps those strings keyed by query id and applies them automatically. ▸ Every query below ran against the L


