Re: Very long deletion time on a 200 GB database

From: Shaun Thomas <sthomas(at)peak6(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: "Reuven M(dot) Lerner" <reuven(at)lerner(dot)co(dot)il>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Very long deletion time on a 200 GB database
Date: 2012-02-27 15:01:13
Message-ID: 4F4B9AB9.6000900@peak6.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)peak6(dot)com

______________________________________________

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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Shaun Thomas 2012-02-27 15:14:13 Re: Very long deletion time on a 200 GB database
Previous Message Reuven M. Lerner 2012-02-27 14:59:57 Re: Very long deletion time on a 200 GB database