Stale statistics cause inefficient query plans with exponentially worse performance
warningperformanceUpdated Mar 4, 2026
Technologies:
How to detect:
When autovacuum does not run ANALYZE frequently enough, query planner statistics become stale. Unlike bloat which causes linear performance degradation through extra I/O, stale statistics can cause the planner to choose exponentially inefficient query plans, drastically increasing CPU, I/O, and execution time.
Recommended action:
Monitor n_mod_since_analyze in pg_stat_all_tables to detect tables with stale statistics. Ensure autovacuum is running regularly. For critical tables with rapidly changing data, consider running manual ANALYZE or adjusting autovacuum_analyze_threshold and autovacuum_analyze_scale_factor. Note that ANALYZE has higher overhead than VACUUM as it must rebuild statistics every time.