A utility command for carrying out garbage collection on a database

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 been present in every PostgreSQL version. It is not part of the SQL standard.

Since PostgreSQL 8.1, regular garbage collection and statistics collection is automatically carried out by the autovacuum process.

Change history


  • PostgreSQL documentation: VACUUM


Management / adminstration, Performance, SQL command

See also

vacuumdb, autovacuum, ANALYZE