The Mike Files

Laus Deo Semper

Archive for the ‘PostgreSQL’ Category

Vaccumdb – Saves your Day!

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.

vacuumdb is a utility for cleaning a PostgreSQL database. vacuumdb will also generate internal statistics used by the PostgreSQL query optimizer.” – From http://www.cyberciti.biz/tips/postgresql-get-back-storage-occupied-by-deleted-tuples-or-records.html

Written by themikefiles

March 2, 2009 at 5:32 pm

Posted in Open Source, PostgreSQL

Tagged with

Follow

Get every new post delivered to your Inbox.