Re: VACUUM and open transactions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Joseph S <jks(at)selectacast(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: VACUUM and open transactions
Date: 2007-01-31 04:08:58
Message-ID: 15140.1170216538@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
>>> Right. This is expected. VACUUM cannot remove them because the
>>> serializable transaction might still want to see those rows.

> Joseph S wrote:
>> The serializable transaction *can't* see those rows, they were created
>> and obsoleted after the start of the transaction. The point of make the
>> transaction serializable in the first place was to allow VACUUM to
>> reclaim those rows.

> Well, if you're thinking that vacuum will reclaim those rows just
> because the transaction is serializable and thus the rows are invisible,
> you're mistaken.

VACUUM doesn't even know that the transaction is serializable, much less
specific details of which other transactions it can or can't see the
effects of. The rule is that anything newer than the "xmin" advertised
by the transaction might be visible.

This is, of course, an engineering tradeoff: we could cause transactions
to advertise more-complete details of the snapshots they're using, and
then try to teach VACUUM to take advantage of that knowledge. But the
distributed overhead of that is daunting, and the benefits uncertain.
Personally I think that xmin-only advertisement is a pretty good
tradeoff.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2007-01-31 04:14:52 Re: Index bloat of 4x
Previous Message Bruce Momjian 2007-01-31 03:18:32 Re: Index bloat of 4x