Tracking plan shapes over time with Plan IDs, and a new pg_stat_plans
summary
A patch adds a plan ID field in PlannedStmt so extensions can record plan shapes; a new pg_stat_plans extension (PGstep 2.0) uses the cumulative statistics API and a fast tree‑walk jumble to compute plan IDs, stores plan texts in dynamic shared memory with optional compression, and can map a plan ID to a running backend. Measured overhead is a few percent (around 5%) versus ~20–25% for pg_store_plans; extension is functional but not yet production‑stable.
AI-written summary · about
chapters (6)
- 0:00Introduction to plan IDs
- 3:50Why plan IDs matter
- 10:06Core vs extension trade-offs
- 13:16Introducing pg_stat_plans 2.0
- 17:30Performance and next steps
- 21:42Q&A on plan tracking
related talks
29mTracking plan shapes over time with Plan IDs and the new pg_stat_plans
31mpg_stat_advisor: Optimizing PostgreSQL Planner with Insights
26mBe Good Friends with Query Planner
36mAdvice is seldom welcome but efficacious
30mReproduce those complex query planner issues
52mUnderstanding PostgreSQL Query Plans (aka EXPLAIN)
57mQuery Logging and Workload Analysis
04mEnhancing Planner Estimates with Extended Statistics in PostgreSQL
