ANALYZE collects statistics about table contents so PostgreSQL’s query planner can choose more suitable execution plans. It is also run as part of VACUUM ANALYZE. section 6.7
Treat ANALYZE as part of routine maintenance rather than an optional manual optimization:
- Autovacuum automatically checks tables and performs VACUUM and/or ANALYZE when needed. section 6.7
- Disabling autovacuum may produce a short-term performance gain, but stale statistics and accumulated bloat can make later queries slower. section 6.7
- VACUUM ANALYZE combines dead-tuple cleanup, index cleanup, and statistics collection. section 6.7
The tempting maintenance shortcut
Turning off autovacuum can appear successful while developers and users notice an immediate improvement. As table and index bloat accumulate, scans process more junk on disk, and the temporary gain is outweighed by degraded performance. section 6.7

