Re: VACUUM process running for a long time

From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: Jan Krcmar <honza801(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: VACUUM process running for a long time
Date: 2010-04-14 19:54:55
Message-ID: 4BC61D8F.1070701@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jan Krcmar wrote:
>> You might consider partitioning this table by date, either by day or by
>> week, and instead of deleting old rows, drop entire old partitions
>>
> this is not really good workaround...
>

It is in fact the only good workaround for your problem, which you'll
eventually come to realize if you struggle with this class of problem
for long enough. You can continue to fight with autovacuum forever, but
it's a battle you'll never quite win if you're deleting 2GB per day.
Even if you get vacuum running often enough to clean up the space,
you'll still have a constant struggle to keep your indexes working
efficiently.

Or you can partition by day or week and make the entire problem go
away. Dropping an old partition requires no vacuum cleanup and leaves
behind no index issues. It really is the right solution here if you
want to solve this problem once, rather than continuing to fight it a
little every single day forever.

--
Greg Smith 2ndQuadrant US Baltimore, MD
PostgreSQL Training, Services and Support
greg(at)2ndQuadrant(dot)com www.2ndQuadrant.us

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2010-04-14 20:18:02 Re: pl/java status
Previous Message Bill Moran 2010-04-14 19:31:06 Re: auto vacuum