vacuumdb - refuse collection and analysis of a PostgreSQL database

SYNOPSIS

vacuumdb [ connection-option...] [ --full | -f ] [ --verbose | -v ] [ --analyze | -z ] [ --table | -t table [ ( column [,...] ) ]] [ dbname]

vacuumdb [ connection-options...] [ --all | -a ] [ --full | -f ] [ --verbose | -v ] [ --analyze | -z ]

DESCRIPTION Description

vacuumdb is a finishing tool for PostgreSQL database. vacuumdb will also generate internal statistics used by the PostgreSQL query optimizer.

vacuumdb a SQL command the VACUUM [ Vacuum packaging (7)] of. So, which method is used to clean up the database are nothing special.

OPTIONS Options

vacuumdb accepts the following command line arguments:

-a
--all

 Clean up all databases.
[-d] dbname
[--dbname] dbname

 To declare the name of the database to be cleaned or analyzed. If this is not specified and there is no use -a (or --all), database name is read from the environment variable PGDATABASE years. If that is not set, the user name of the connection is used.
-e
--echo

 Echo vacuumdb generates and sends it to the server.
-f
--full

 The implementation of "completely" clean.
-q
--quiet

 Not display a response.
-t table [ ( column [,...]) ]
--table table [ ( column [,...]) ]

 Just clean up or analysis table. Field name just need to declare only in conjunction with --analyze options.

 

Tip: Tip: If you want to declare a clean field, you might have to escape the parentheses from the shell (see example below).

 

-v
--verbose

 Print detailed information during processing.
-with
--analyze

 Calculating statistics of the database for the optimizer.

 

vacuumdb also accepts the following command line arguments for connection parameters:

-h host
--host host

 Host name of the machine running the server. If host begins with a slash, it is used for the Unix domain socket.
-p port
--port Port

 Disclaimer server Unix domain socket file is listening for connections on TCP port number or a local.
-U username
--username username

 User name of the connection.
-W
--password

 Force password prompt.

 

ENVIRONMENT Environment

PGDATABASE
PGHOST
PGPORT
PGUSER

 The default connection parameters

DIAGNOSTICS diagnosis


 If it goes wrong. See the VACUUM [ Vacuum (7)] and  psql (1) for a detailed description of the error messages and possible problems. The database server must be running on the target host. Also, any default connection used by libpq front-end library settings and environment variables are applicable.

NOTES Note

vacuumdb may need to connect several times to the PostgreSQL server, asking for a password each time. In this case, the establishment of a $ HOME / .pgpass is more convenient. See Section 27.11 for more information.

EXAMPLES Examples


 To clean the database test:

 

$ vacuumdb test


 In order to optimize clean and analyze a database named bigdb:

 

$ vacuumdb --analyze bigdb


 To clean up the database xyzzy in table foo, bar and analysis columns for the optimizer:

 

$ vacuumdb --analyze --verbose --table 'foo(bar)' xyzzy

Guess you like

Origin www.cnblogs.com/fanweisheng/p/11102207.html