Database Performance Investigation Runbook#
When a database is slow, resist the urge to immediately tune configuration parameters. Follow this sequence: identify what is slow, understand why, then fix the specific bottleneck. Most performance problems are caused by missing indexes or a single bad query, not global configuration issues.
Phase 1 – Identify Slow Queries#
The first step is always finding which queries are consuming the most time.
PostgreSQL: pg_stat_statements#
Enable the extension if not already loaded: