Loading…
Topic
pg_plan_advice
1 post about pg_plan_advice. Every summary links to the original.
- 1 post
- 1 company
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
Newest first
Posts
Hints and hazards: pg_plan_advice in PG19
Postgres 19 introduces pg_plan_advice and pg_stash_advice, two contrib modules that provide a query hint experience without affecting all queries or SQL syntax. pg_plan_advice works at the session level via SET commands, while pg_stash_advice applies hints to specific query identifiers. The extensions support specifying scan method, join order, join method, parallelism, partitionwise joins, and semijoin uniqueness. They work by telling the planner not to pick unselected options, but if no viable plan exists the advice is partially or fully ignored, and there is no check that the advice is good. The article demonstrates that while hints can dramatically improve performance in some scenarios, shifting data distributions can make them counterproductive, as shown by a bitmap heap scan hint that went from a 150x improvement to a 7,000x degradation.
Weekly digest
The best engineering reads, once a week.