WARNING

This text was automatically converted from troff me macros to HTML. Information may have been lost, added, or changed in the process. Lars Aronsson and Lysator do not guarantee the correctness of this HTML document.

NAME

vacuum *- vacuum a database

SYNOPSIS

vacuum

DESCRIPTION

Vacuum is the POSTGRES 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 vacuum periodically will increase POSTGRES' speed in processing user queries.

The open database is the one that is vacuumed. This is a new POSTQUEL command in Version 4.0; earlier versions of POSTGRES had a separate program for vacuuming databases. That program has been replaced by the vacuum shell script; see vacuum (unix) for details.

We recommend that production databases be vacuumed nightly, in order to keep statistics relatively current. The vacuum query may be executed at any time, however. In particular, after copying a large class into POSTGRES or deleting a large number of records, it may be a good idea to issue a vacuum query. This will update the system catalogs with the results of all recent changes, and allow the POSTGRES query optimizer to make better choices in planning user queries.

SEE ALSO

vacuum(unix).