PostGres VACUUM

Today we had some problems with a database getting slow, then we had to vacuum that baby .!!

As records are updated in Postgres, files become a bit unorganized and bulky. This condition can get very bad as more records are updated and added.

Vacuum is a command that sort of makes the problem better for you.

When run the first time on a database that has run for quite some time, you will immediately see the performance increase.

There are three(/4) types of Vacuums that can be done on a database

1. VACUUM
This is a standard vacuum. Least intensive and just marked the unused spaced in the file.

2. ANALYZE VACUUM
This updates the index.

3. FULL
This physically removes the unused spaced in the file.

Usage :
VACUUM [ FULL ] [ FREEZE ] [ VERBOSE ] ANALYZE [ table [ (column [, …] ) ] ]

Leave a Reply

Your email address will not be published. Required fields are marked *