Re: HOT patch - version 15 - Mailing list pgsql-patches

From Gregory Stark
Subject Re: HOT patch - version 15
Date
Msg-id 87wsv4tiv3.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: HOT patch - version 15  ("Pavan Deolasee" <pavan.deolasee@gmail.com>)
List pgsql-patches
"Pavan Deolasee" <pavan.deolasee@gmail.com> writes:

> On 9/6/07, Gregory Stark <stark@enterprisedb.com> wrote:
>
>> Ah, as I understand it you can't actually do the pruning then because the
>> executor holds references to source tuple on the page. In other words you
>> can never "get the vacuum lock" there because you already have the page
>> pinned yourself.
>
> I don't think executor holding a reference is a problem because when
> we check for vacuum lock, we have already pinned the page anyways.

But that's the point. Even though the pin-count is 1 and it may look like we
have the vacuum lock we really don't. The fact that the buffer was already
pinned by us means that there are already pointers around referencing tuples
on that page. If we move them around those pointers become garbage. In fact
Postgres avoids copying data if it can get by with a pointer at the original
tuple on disk so some of the pointers will be Datums pointing at individual
columns in the tuples in the page.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com

pgsql-patches by date:

Previous
From: "Pavan Deolasee"
Date:
Subject: Re: HOT patch - version 15
Next
From: "Heikki Linnakangas"
Date:
Subject: Re: HOT patch - version 15