Re: Alternative for vacuuming queue-like tables

From: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
To: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
Cc: Postgres general mailing list <pgsql-general(at)postgresql(dot)org>, Chris Browne <cbbrowne(at)acm(dot)org>
Subject: Re: Alternative for vacuuming queue-like tables
Date: 2006-05-02 09:45:10
Message-ID: 1146563110.14093.120.camel@coppola.muc.ecircle.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> > I guess what I'm asking for is a kind of "REBUILD TABLE" which is not
> > MVCC by definition but it would be useful in the mentioned queue table
> > case.
> >
>
> vaccum full ?

Nope, it won't work, it will still leave in all the dead tuples
potentially visible by old transactions, even if those transactions
didn't touch yet the vacuumed table. In my case that means for some
tables sometimes 1000s times of bloat, given that the table always has
few active rows and high insert/update/delete rates...

CLUSTER is locking the table exclusively, which means it will wait until
all transactions which actually touched the table are finished, and then
rebuild the table, ignoring dead rows, without caring about old
transactions who could still see the dead rows (at least this is how I
think it works based on my observations). Perfect for my purpose, but
not MVCC...

Cheers,
Csaba.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Florian G. Pflug 2006-05-02 09:57:27 Using a pointer as statetype for an aggregate
Previous Message Martijn van Oosterhout 2006-05-02 09:15:01 Re: How would I write this query...