vacuumdb - garbage-collect and analyze a PostgreSQL database
vacuumdb [OPTION]... [DBNAME]
Options you will use
-a, --all- vacuum all databases.
-z, --analyze- update optimizer statistics.
-Z, --analyze-only- only update optimizer statistics; no vacuum.
--analyze-in-stages- only update optimizer statistics, in multiple stages for faster results (after pg_upgrade).
-F, --freeze- freeze row transaction information.
-f, --full- do full vacuuming (rewrites the table, ACCESS EXCLUSIVE lock).
-t, --table=TABLE- vacuum specific table(s) only.
-j, --jobs=NUM- use this many concurrent connections to vacuum.
-v, --verbose- write a lot of output.
-h, --host=HOSTNAME- database server host or socket directory (default: the Unix socket in /var/run/postgresql). A value starting with / is a socket directory; anything else is TCP.
-p, --port=PORT- database server port (default 5432).
-U, --username=USERNAME- database user name (default: your OS user name).
-w, --no-password- never prompt for a password (fail instead: what scripts want).
-W, --password- force a password prompt (normally automatic).
Examples
$ sudo -u postgres vacuumdb --all --analyzevacuum and analyze every database
$ sudo -u postgres vacuumdb --all --freezethe wraparound emergency
Try vacuumdb in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.