How would you troubleshoot a slow query using execution plans?
Explain a repeatable PostgreSQL workflow for identifying the bottleneck, validating whether indexes are useful, and separating planner estimates from actual execution behavior. Address join strategies, row estimates, sorting, aggregation, buffer activity, and statistics.
Output
- A concise diagnosis workflow and the plan evidence to inspect
- Recommended validation steps and possible corrective actions
- A PostgreSQL query that can be analyzed with
EXPLAIN (ANALYZE, BUFFERS)