commands.sh

vacuumdb

all

Garbage-collect and analyze a PostgreSQL database.

More info →

Options (5)

-a, --allboolean

Vacuum all databases

Example: vacuumdb {{[-a|--all]}}
-t, --tableboolean

Vacuum a specific table in a database

Example: vacuumdb {{[-t|--table]}} {{table_name}} {{database_name}}
-z, --analyzeboolean

Vacuum and update statistics for the query planner

Example: vacuumdb {{[-z|--analyze]}} {{database_name}}
-f, --fullboolean

Perform a full vacuum (more aggressive, locks tables, rewrites the whole table)

Example: vacuumdb {{[-f|--full]}} {{database_name}}
-v, --verboseboolean

Vacuum with verbose output

Example: vacuumdb {{[-v|--verbose]}} {{database_name}}

Examples (7)

Vacuum a specific database

vacuumdb database_name

Vacuum all databases

vacuumdb [-a|--all]

Vacuum a specific table in a database

vacuumdb [-t|--table] table_name database_name

Vacuum and update statistics for the query planner

vacuumdb [-z|--analyze] database_name

Perform a full vacuum (more aggressive, locks tables, rewrites the whole table)

vacuumdb [-f|--full] database_name

Vacuum with verbose output

vacuumdb [-v|--verbose] database_name

Vacuum a database using multiple parallel jobs

vacuumdb --jobs number_of_jobs database_name
made by @shridhargupta | data from tldr-pages