pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steve <steve@hotmail.com>
To: pgsql-admin@postgresql.org
Subject: Re: please please please PLEASE help!
Date: Fri, 30 Jul 2004 10:14:19 +1000
Message-ID: <cec3uq$197h$1@news.hub.org> (raw)
In-Reply-To: <NJEBKAGMPKNPDHGFFJJDKEJLCHAA.rbamber@openworld.org>
References: <410914E1.3000808@musicrebellion.com>
	<NJEBKAGMPKNPDHGFFJJDKEJLCHAA.rbamber@openworld.org>



Rob Bamber wrote:
> Another thought -
> 
> 	We had a similar issue recently.  Our support guys dropped the database and
> then rebuilt it from a dump file.  The size of the data directory went down
> from 12GB to less than 2GB.  According to the sys ad that did the work
> postgres is not very good a reclaiming disk space after large quantities of
> tuples are deleted over time.
> 
> HTH
> 

That's because you need to 'VACUUM [FULL | ANALYZE]' the database 
frequently. For example, in our case there are about 2000 
updates/inserts and around 50 'deletes' every 3 minutes . 'Update' and 
'delete' operations are most expensive (in terms of disk space 
utilization) as they tend to keep the updated/deleted tuples for a 
longer period of time, until VACUUM is run. I've set it up so that a 
daemon runs VACUUM ANALYZE every 6 minutes or so, and then a full 
vacuum, i.e. VACUUM FULL ANALYZE, every 30 mins. As far as I know, in 
postgresql 7.4, a simple VACUUM operation doesn't block read operations 
and so occassianlly running VACUUM on the most 'popular' tables would be 
a good idea. I'm sure in your case the frequency of calling vacuum could 
vary, but that is basically why the database reduced to 2GB from 12GB. 
VACUUM basically deletes unwanted tuples and indexes and so 'compresses' 
the amount of disk space used (and so effectively speeding up queries 
two to three orders of magnitude).

Steve




view thread (9+ messages)  latest in thread

Message-ID: <cec3uq$197h$1@news.hub.org>
Permalink:  ../cec3uq$197h$1@news.hub.org/
Also on:    postgresql.org/message-id/cec3uq$197h$1@news.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: steve@hotmail.com
  Subject: Re: please please please PLEASE help!
  In-Reply-To: <cec3uq$197h$1@news.hub.org>
  References: <410914E1.3000808@musicrebellion.com> <NJEBKAGMPKNPDHGFFJJDKEJLCHAA.rbamber@openworld.org> <cec3uq$197h$1@news.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox