vacuum.hlp
上传用户:blenddy
上传日期:2007-01-07
资源大小:6495k
文件大小:2k
- .pgaw:Help.f.t insert end
- "VACUUM" {bold} " serves two purposes in Postgres as both a means to reclaim storage and also a means to collect information for the optimizer.
- VACUUM opens every class in the database, cleans out records from rolled back 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 the speed of the database in processing user queries.
- " {} "Notes:" {italic} " The open database is target for VACUUM.
- We recommend that active production databases be cleaned 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 after 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.
- If the server crashes during a VACUUM command, chances are it will leave a lock file hanging around. Attempts to re-run the VACUUM command result in an error message about the creation of a lock file. If you are sure VACUUM is not running, remove the pg_vlock file in your database directory (i.e. PGDATA/base/dbname/pg_vlock).
- " {} "Synopsis" {bold} "
- VACUUM [ VERBOSE ] [ ANALYZE ] [ table ]
- VACUUM [ VERBOSE ] ANALYZE [ table [ (column [, ...] ) ] ]
- " {code} "VERBOSE" {italic} "
- Prints a detailed vacuum activity report for each table.
- " {} "ANALYZE" {italic} "
- Updates column statistics used by the optimizer to determine the most efficient way to execute a query. The statistics represent the disbursion of the data in each column. This information is valuable when several execution paths are possible.
- " {} "table" {italic} "
- The name of a specific table to vacuum. Defaults to all tables.
- " {} "column" {italic} "
- The name of a specific column to analyze. Defaults to all columns. "