Garbage-collects and analyzes a database.
vacuumdb [<connection-option>...] [--full | -f] [--freeze | -F] [--verbose | -v] [--analyze | -z] [--analyze-only | -Z] [--disable-page-skipping] [--skip-locked] [--table | -t <table> [( <column> [,...] )] ] [<dbname>] vacuumdb [<connection-option>...] [--all | -a] [--full | -f] [-F] [--verbose | -v] [--analyze | -z] [--analyze-only | -Z] [--disable-page-skipping] [--skip-locked] vacuumdb -? | --help vacuumdb -V | --version
vacuumdb is a utility for cleaning a Greenplum Database database.
vacuumdb will also generate internal statistics used by the Greenplum Database query optimizer.
vacuumdb is a wrapper around the SQL command
VACUUM. There is no effective difference between vacuuming databases via this utility and via other methods for accessing the server.
--all) is not used, the database name is read from the environment variable
PGDATABASE. If that is not set, the user name specified for the connection is used.
reindexdbgenerates and sends to the server.
VACUUM FULLis not recommended in Greenplum Database.
--analyze-alloptions. Multiple tables can be vacuumed by writing multiple
-tswitches. If you specify columns, you probably have to escape the parentheses from the shell.
vacuumdbversion and exit.
vacuumdbcommand line arguments, and exit.
PGHOSTor defaults to localhost.
PGPORTor defaults to 5432.
PGUSERor defaults to the current system user name.
.pgpassfile, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.
postgresdatabase will be used, and if that does not exist,
template1will be used.
vacuumdb might need to connect several times to the coordinator server, asking for a password each time. It is convenient to have a
~/.pgpass file in such cases.
To clean the database
To clean and analyze a database named
vacuumdb --analyze bigdb
To clean a single table
foo in a database named
mydb, and analyze a single column
bar of the table. Note the quotes around the table and column names to escape the parentheses from the shell:
vacuumdb --analyze --verbose --table 'foo(bar)' mydb