pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shaun Thomas <sthomas@peak6.com>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: Reuven M. Lerner <reuven@lerner.co.il>
Cc: pgsql-performance@postgresql.org
Subject: Re: Very long deletion time on a 200 GB database
Date: Mon, 27 Feb 2012 09:01:13 -0600
Message-ID: <4F4B9AB9.6000900@peak6.com> (raw)
In-Reply-To: <4F4B9907.60008@dunslane.net>
References: <4F45FB55.1020600@lerner.co.il>
	<4F47C6C4.6030102@pinpointresearch.com>
	<4F4B39EF.2080004@lerner.co.il>
	<4F4B9721.6050808@peak6.com>
	<4F4B9907.60008@dunslane.net>

On 02/27/2012 08:53 AM, Andrew Dunstan wrote:

> If he has autovacuum on he could well be just fine with his proposed
> strategy. Or he could have tables partitioned by time and do the delete
> by just dropping partitions. There are numerous way he could get this to
> work.

He isn't using partitions though. That's the whole reason for this 
thread. Having autovacuum turned on (which should be the case for 8.4 
and above anyway) will not magically remove the old rows. VACUUM marks 
rows as dead/reusable, so INSERT and UPDATE statements will take the 
dead spots instead of creating new extents.

Like I said, this will stop his tables from growing further so long as 
he keeps his maintenance functions running regularly from now on, but 
the existing rows he's trying to delete will never go away until he runs 
a CLUSTER or some other system of actually purging the dead rows.

Notice how I don't suggest using VACUUM FULL. :)

-- 
Shaun Thomas
OptionsHouse | 141 W. Jackson Blvd. | Suite 500 | Chicago IL, 60604
312-444-8534
sthomas@peak6.com

______________________________________________

See http://www.peak6.com/email_disclaimer/ for terms and conditions related to this email



view thread (42+ messages)  latest in thread

Message-ID: <4F4B9AB9.6000900@peak6.com>
Permalink:  ../4F4B9AB9.6000900@peak6.com/
Also on:    postgresql.org/message-id/4F4B9AB9.6000900@peak6.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: sthomas@peak6.com, andrew@dunslane.net, reuven@lerner.co.il
  Subject: Re: Very long deletion time on a 200 GB database
  In-Reply-To: <4F4B9AB9.6000900@peak6.com>

* 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