VACUUM is a utility command for manually carrying out garbage collection on a database. It can be optionally combined with the ANALYZE command for collecting table statistics.
VACUUM has always present in PostgreSQL. It is a PostgreSQL extension and is not part of the SQL standard.
VACUUM and autovacuum
Since PostgreSQL 8.1, regular garbage collection and statistics collection is automatically carried out by the autovacuum process.
Monitoring VACUUM progress
- PostgreSQL 14
- PostgreSQL 13
PARALLELadded (commit 40d964ec)
- PostgreSQL 12
- PostgreSQL 9.6
DISABLE_PAGE_SKIPPINGadded (commit ede62e56)
- PostgreSQL 9.0
VACUUM FULLnow performs a full table rewrite (initial commit 0a469c87)
- PostgreSQL 6.1
ANALYZEadded (commit 24d48db3)