Re: Very long deletion time on a 200 GB database - Mailing list pgsql-performance

From Shaun Thomas
Subject Re: Very long deletion time on a 200 GB database
Date
Msg-id 4F4B9AB9.6000900@peak6.com
Whole thread Raw
In response to Re: Very long deletion time on a 200 GB database  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: Very long deletion time on a 200 GB database  (Claudio Freire <klaussfreire@gmail.com>)
List pgsql-performance
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

pgsql-performance by date:

Previous
From: "Reuven M. Lerner"
Date:
Subject: Re: Very long deletion time on a 200 GB database
Next
From: Shaun Thomas
Date:
Subject: Re: Very long deletion time on a 200 GB database