PostgreSQL's VACUUM command has to process each table on a regular basis for several reasons: to recover or reuse disk space occupied by updated or deleted rows, to update data statistics used by the PostgreSQL query planner, to update the visibility map which speeds up index-only scans, and to protect against loss of very old data due to transaction ID wraparound or multixact ID wraparound. There are two variants: standard VACUUM and VACUUM FULL. VACUUM FULL can reclaim more disk space but runs much more slowly and requires an ACCESS EXCLUSIVE lock on the table it is working on, so it cannot be done in parallel with other use of the table; the standard form of VACUUM can run in parallel with production database operations such as SELECT, INSERT, UPDATE, and DELETE, and administrators should generally strive to use standard VACUUM and avoid VACUUM FULL. For many installations it is sufficient to let vacuuming be performed by the autovacuum daemon, which is enabled in the default configuration, though you might need to adjust the autovacuuming parameters to obtain best results for your situation. The planner relies on statistical information about the contents of tables to generate good plans; these statistics are gathered by the ANALYZE command, which can be invoked by itself or as an optional step in VACUUM, and the autovacuum daemon will automatically issue ANALYZE commands whenever the content of a table has changed sufficiently. It is important to have reasonably accurate statistics, otherwise poor choices of plans might degrade database performance. Scope: PostgreSQL current-release documentation. Reviewed October 4, 2026.
Routine VACUUM and up-to-date planner statistics
Document v1 · published by Koskamo editorial · updated 2026-10-04
Source and provenance
- Original source
- www.postgresql.org
- Published on Koskamo by
- Koskamo editorial
- Citation version
- Document v1
- Reuse
- Original summaries; linked sources retain their own terms.