Christophe Pettus reviews four legacy logging parameters in PostgreSQL that track CPU time, page faults, and context switches for individual statements. These metrics provide low-level operational visibility into query execution costs that modern tools often obscure. They remain essential for diagnosing performance bottlenecks where standard slow query logs are insufficient.
- Use log_parser_stats to measure parsing overhead and CPU time spent on query analysis.
- Enable log_planner_stats to identify expensive query planning phases and optimization choices.
- Log executor stats to pinpoint execution time, page faults, and context switch costs.
- Combine all four GUCs for a complete picture of statement-level resource consumption.
- These crude metrics are irreplaceable for deep-dive performance root cause analysis.