Re: Obtaining the exact size of the database. - Mailing list pgsql-performance

From Greg Smith
Subject Re: Obtaining the exact size of the database.
Date
Msg-id 4C1E7439.4000800@2ndquadrant.com
Whole thread Raw
In response to Obtaining the exact size of the database.  (venu madhav <venutaurus539@gmail.com>)
Responses Re: Obtaining the exact size of the database.
List pgsql-performance
venu madhav wrote:
> The problem here is even though some records are cleared, it still
> shows the original DB Size. Is there any way to find out the actual DB
> Size or it would be more useful, if I can get the size of each table.

One of the queries at http://wiki.postgresql.org/wiki/Disk_Usage should
give you the breakdown per table.  Regular VACUUM doesn't ever shrink
the database from the operating system perspective unless you hit a very
unusual situation (all of the free space is at the end).  There is no
way to do that without system downtime of sorts in the form a
potentially long database lock, such as VACUUM FULL (the main option on
8.1, the alternative of using CLUSTER isn't a good idea until 8.3).  The
best you can do is making sure you VACUUM often enough that space is
regularly reused.

It's hard to run a 24x7 environment on 8.1.  Much easier on 8.4, where
the major things that regularly left people with quite bad VACUUM
cleanup situations are all less likely to occur than on any previous
version.

--
Greg Smith  2ndQuadrant US  Baltimore, MD
PostgreSQL Training, Services and Support
greg@2ndQuadrant.com   www.2ndQuadrant.us


pgsql-performance by date:

Previous
From: Greg Smith
Date:
Subject: Re: B-Heaps
Next
From: Scott Marlowe
Date:
Subject: Re: Aggressive autovacuuming ?