Re: Space usage

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Anantha V Padmanaban" <ananthin(at)hotmail(dot)com>, <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Space usage
Date: 2009-08-13 18:11:50
Message-ID: 4A8411160200002500029A44@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Anantha V Padmanaban <ananthin(at)hotmail(dot)com> wrote:

> Version 8.1

It's generally best to give a full version number; many problems exist
in 8.1.0 that don't exist in 8.1.17. Hopefully you're on the latest
bug fix release.

http://www.postgresql.org/support/versioning

> I am new to postgres

Then you should probably be looking at 8.3.latest or 8.4.latest, not
8.1.

> and trying to find a way to get the actual space usage of a table.
> The table size is 28GB but I have deleted a lot of rows which is
> not getting reflected. I presume the space will be reclaimed after
> the vacuum process.

A normal vacuum will free the space for reuse within the database, it
will not release it back to the OS. To do that you would need to use
VACUUM FULL (followed by REINDEX) or CLUSTER. These are aggressive
maintenance operations, which should not normally be needed.

> But I would like to know how much space left in the database. Is
> there anyway we can find how much space will be released after
> vacuuming process?

Someone might be able to suggest something simpler, but you can pick
an interesting query (after the comment "this was fun to write") from
the pl script here:

http://bucardo.org/nagios_postgres/

-Kevin

In response to

  • Space usage at 2009-08-11 07:48:20 from Anantha V Padmanaban

Browse pgsql-admin by date

  From Date Subject
Next Message Greg Sabino Mullane 2009-08-13 20:28:33 Re: Replication for R/W offline use
Previous Message Ray Stell 2009-08-13 15:09:10 VACUUM WARNING: skipping