pg_plan_advice: Plan Stability and User Planner Control for PostgreSQL?
summary
A contrib module called pg_plan_advice implements a round‑trip mini‑language that records planner decisions (join order, join method, scan type) and can reapply or edit them; it targets inclusion in PostgreSQL 19. It adds small plan annotations (RTI tracking for result nodes) and a new planner mask pgs_mask so advice disables incompatible paths rather than rewrite the planner. An auxiliary pg_stash_advice maps query IDs to advice; a pluggable advisor hook supplies advice dynamically. The prototype runs and enforces many directives but leaves cardinality hints and some optimizer hooks for future work.
AI-written summary · about
