Reproduce those complex query planner issues
summary
Tool CBO stat dump extracts pg_class relpages/reltuples, pg_statistic and pg_statistic_ext, DDL, GUCs and query plans so a test cluster with empty tables reproduces planner decisions from production. Using Taco revealed Postgres 15 picks best plans only ~30% of the time and speedups up to 16x are possible. Reproduction sometimes needs a pg-15 patch to stop page-count extrapolation and a small insert workaround for pseudo-types; once applied, plan shapes match and enable local debugging and hint-based workarounds.
AI-written summary · about
chapters (6)
- 0:00Introduction to CBO stat dump
- 7:27How CBO stat dump works
- 13:08Live demonstration of the tool
- 20:40Practical use cases and benefits
- 27:45Limitations and future improvements
- 28:27Q&A session
related talks
52mUnderstanding PostgreSQL Query Plans (aka EXPLAIN)
23mBest Practices for Tuning Slow Postgres Queries
56mQuery Planning Gone Wrong
31mpg_stat_advisor: Optimizing PostgreSQL Planner with Insights
50mImproving Postgres' Efficiency
51mPostgreSQL Query Performance Insights
57mQuery Logging and Workload Analysis
29mPerformance Archaeology - 20 years of improvements
