Slow queries consuming excessive total execution time degrade performance
warningperformanceUpdated Feb 15, 2026
Technologies:
How to detect:
Queries with high total_exec_time or mean_exec_time values indicate optimization opportunities. A query running thousands of times daily with 200ms mean execution time consumes more resources than infrequent 10-second queries.
Recommended action:
Query pg_stat_statements ordered by total_exec_time DESC to identify top offenders. Focus optimization on queries with high call counts and moderate execution times, as these provide the best ROI. Review execution plans and add appropriate indexes.