Looking Forward to Postgres 19: Query Hints
- Databases
- Open Source
- Infrastructure
- Developer Tools
The post walks through PostgreSQL 19's likely addition of "plan advice," a new mechanism built around pg_plan_advice. Instead of Oracle-style comment hints that directly dictate execution, this design lets you attach advice that only steers the planner toward plans it already considers valid. That constraint is the whole point. It gives operators a way to stabilize bad edge-case queries without turning SQL into hand-authored execution plans. A key detail people highlighted is `EXPLAIN (PLAN_ADVICE)`, which makes the feature look less like a blunt hint system and more like a plan stability framework that can grow over time. The initial version is still narrow. It does not yet solve everything people want, like directly correcting bad row or join estimates, and it deliberately avoids comment parsing in core.
If you run Postgres at scale, pay attention to this feature as a way to stabilize a few pathological queries across upgrades and skewed workloads. Do not treat it as a substitute for statistics, indexing, monitoring, and periodic query review, because stale advice can lock in yesterday's assumptions.
-
pgedge.com
- Discuss on HN