Re: Obtaining the exact size of the database.

From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: venu madhav <venutaurus539(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Obtaining the exact size of the database.
Date: 2010-06-20 20:04:09
Message-ID: 4C1E7439.4000800@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)2ndQuadrant(dot)com www.2ndQuadrant.us

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Scott Marlowe 2010-06-20 20:13:15 Re: Aggressive autovacuuming ?
Previous Message Greg Smith 2010-06-20 19:57:13 Re: B-Heaps