PostgreSQL

Slow queries exceed execution time threshold

warning
performanceUpdated Jan 30, 2026
Technologies:
How to detect:

Queries taking longer than log_min_duration_statement threshold (e.g., 1000ms) indicate performance issues requiring optimization

Recommended action:

Enable slow query logging by setting log_min_duration_statement to capture queries exceeding threshold (e.g., 1000ms for 1 second). Enable auto_explain with log_min_duration and log_analyze to capture query plans. Review logged queries to identify optimization opportunities through indexing, query rewriting, or schema changes. Use pg_stat_statements to analyze aggregate query performance.