PostgreSQL

Stale statistics cause poor query plans

warning
performanceUpdated Feb 14, 2026
Technologies:
How to detect:

When a query on an indexed column suddenly becomes slow, outdated table statistics may be causing the query planner to choose inefficient execution plans. Statistics become stale after significant data changes.

Recommended action:

Check last_analyze and last_autoanalyze timestamps in pg_stat_user_tables. Run ANALYZE table_name manually to update statistics immediately. Review autovacuum and autoanalyze settings to ensure they run frequently enough for your workload.