.\" XXX standard disclaimer belongs here....
.\" $Header: /private/postgres/ref/postquel/RCS/vacuum,v 1.3 1992/07/14 05:54:17 ptong Exp $
.SP VACUUM COMMANDS 8/11/91
.XA 2 Vacuum
.uh NAME
.lp
vacuum \*- vacuum a database
.uh SYNOPSIS
.lp
.(l
\fBvacuum\fP
.)l
.uh DESCRIPTION
.lp
.b Vacuum
is the \*(PP vacuum cleaner.
It opens every class in the database,
moves deleted records to the archive for archived relations,
cleans out records from aborted transactions,
and updates statistics in the system catalogs.
The statistics maintained include the number of tuples
and number of pages stored in all classes.
Running
.b vacuum
periodically will increase \*(PP' speed in processing
user queries.
.lp
The open database is the one that is
vacuumed.
This is a new \*(PQ command in Version \*(PV;
earlier versions of \*(PP had a separate program for vacuuming
databases.
That program has been replaced by the
.b vacuum
shell script;
see
.b vacuum (unix)
for details.
.lp
We recommend that production databases be vacuumed nightly,
in order to keep statistics relatively current.
The
.b vacuum
query may be executed at any time, however.
In particular, after copying a large class into \*(PP or deleting a large
number of records, it may be a good idea to issue a
.b vacuum
query.
This will update the system catalogs with the results of all recent
changes, and allow the \*(PP query optimizer to make better choices in
planning user queries.
.uh "SEE ALSO"
.lp
vacuum(unix).
