Core concepts for reading plan trees, understanding cost estimation, and diagnosing join strategies.
Explore section →
Understand Every
Query Execution Plan
PostgreSQL's EXPLAIN and EXPLAIN ANALYZE commands expose exactly how the query planner
resolves your SQL — which access paths it chose, where time was spent, and where estimates diverged from reality.
Reading them accurately is the difference between guessing and knowing why a query is slow.
This site provides systematic diagnostic frameworks for every major execution plan pattern:
sequential scan vs index scan trade-offs, hash join memory spill detection,
index-only scan validation via covering indexes, parallel worker allocation, filter
pushdown verification, sort node spill conditions, and more. Each guide includes real
annotated EXPLAIN ANALYZE output, step-by-step remediation workflows,
and the common pitfalls that send engineers in the wrong direction.
Whether you're chasing a p95 latency regression, designing a partial index, or diagnosing why the planner ignores your carefully-crafted B-tree — the answers are in the plan.
Start Here
New to execution plan analysis? These are the highest-leverage pages to read first — each one equips you with a diagnostic tool you can apply immediately.
- Sequential vs Index Scans — understand when the planner chooses each access path and how to influence the decision
- Cost Estimation Models — how PostgreSQL assigns cost units and why row-estimate accuracy is the root cause of most bad plans
- Identifying Plan Bottlenecks — a systematic method for locating the hot node in any EXPLAIN output
- Covering Index Design — eliminate heap fetches entirely with index-only scans
- Hash Join Mechanics — diagnose memory spill and Batches > 1 before they hit production
- Filter Pushdown Mechanics — distinguish Filter from Index Cond in plan output and understand why it matters
Explore the Guides
Systematic workflows for designing, optimizing, and maintaining indexes to eliminate I/O bottlenecks.
- B-Tree Index Optimization
- Covering Index Design
- Partial Index Implementation
- Specialized Index Types (GIN/GiST)
Frameworks for identifying bottlenecks, understanding parallel execution, and validating tuning outcomes.
- Filter Pushdown Mechanics
- Identifying Plan Bottlenecks
- Parallel Query Execution
- Sort and Hash Node Analysis