Posts Tagged ‘database’

Vacuumdb – Saves your day!

03/02/2009 Leave a comment

Well just to post here how to do some garbage cleanup and analysis (similar with dbcc shrinkdatabase in SQL Server) using a Postgre utility which can reclaim storage occupied by deleted tuples.

bash-3.00# /PostgreSQL/bin/vacuumdb -p 5432 -U sa -z -d inventory_db

“In normal PostgreSQL operation, tuples that are deleted or obsolete by an update are not physically removed from their table; they remain present until a VACUUM is done. Therefore, it is necessary to do VACUUM periodically, especially on frequently updated tables.

The vacuumdb is a utility for cleaning a PostgreSQL database. vacuumdb will also generate internal statistics used by the PostgreSQL query optimizer.” – From

Categories: Technology Tags: , ,