Skip to main content

Command Palette

Search for a command to run...

Using Vacuumdb in PostgreSQL

Updated
1 min read

I read in the PostgreSQL docs that vacuumdb or vacuum should be used on the databases every day. I have been running it manually the last couple of days and it has made a difference on query response times. I highly recommend using it.

To vacuum one database from the command line.

vacuumdb -d MyDB -v -z -U postgres

To vacuum one database from the command line.

vacuumdb -a -v -z -U postgres

-d = database name
-v = verbose output
-z = analyze
-U = username
-a = vacuum all databases

More from this blog

Untitled Publication

29 posts

Using Vacuumdb in PostgreSQL