next up previous contents
Next: Encryption and decryption Up: Managing databases Previous: Destroying a database   Contents

Vacuum

In PostgreSQL, the rows that are deleted by an update operation are not physically removed from their tables; they remain present until a VACUUM is done. Therefore it is necessary to do VACUUM periodically on frequent-updated tables.

The Vacuum button on the Create & Drop Database dialog offers a convenient way to do VACUUM.

To vacuum a database,

  1. Select the database you are going to vacuum in the table on the Create & Drop Database dialog.
  2. Click the Vacuum button.

By doing that, the following command will be executed.

vacuum full analyze;

ANALYZE updates statistics used by the planner to determine the most efficient way to execute a query. VACUUM ANALYZE performs a VACUUM and then an ANALYZE sequentially, which is useful combination for routine maintenance. See the PostgreSQL Documentation for a more detailed explanation of VACUUM and ANALYZE.



manabu 2010-11-14