Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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 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 

Greg Smith  2ndQuadrant US  Baltimore, MD
PostgreSQL Training, Services and Support

In response to


pgsql-performance by date

Next:From: Scott MarloweDate: 2010-06-20 20:13:15
Subject: Re: Aggressive autovacuuming ?
Previous:From: Greg SmithDate: 2010-06-20 19:57:13
Subject: Re: B-Heaps

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group