Re: HOT for PostgreSQL 8.3 - Mailing list pgsql-hackers

From Pavan Deolasee
Subject Re: HOT for PostgreSQL 8.3
Date
Msg-id 2e78013d0702111954p6e6054f2s8ab11701c0de0ac@mail.gmail.com
Whole thread Raw
In response to Re: HOT for PostgreSQL 8.3  (Heikki Linnakangas <heikki@enterprisedb.com>)
Responses Re: HOT for PostgreSQL 8.3  ("Simon Riggs" <simon@2ndquadrant.com>)
List pgsql-hackers

On 2/12/07, Heikki Linnakangas <heikki@enterprisedb.com> wrote:
Hannu Krosing wrote:
> Ühel kenal päeval, P, 2007-02-11 kell 12:35, kirjutas Tom Lane:
>> Hannu Krosing <hannu@skype.net> writes:
>>> What if we would just reuse the root tuple directly instead of turning
>>> it into a stub ?
>>> This would create a cycle of ctid pointers, which changes the lookup
>>> process from 'follow ctid chaint until the end' to 'follow the tid chain
>>> until you reach the start'.
>> How do you know which one is newest?
>
> By xmin,cmin of course .
>
>> What happens when you have to put a newer version off-page for lack of space?
>
> Then this scheme won't work.

Couldn't the ctid of the latest tuple point to the off-page tuple as usual?

It could. But then you may lose reference for older version(s). We can do
the whole page scans to locate older versions, but that might prove too
costly
 

It might be acceptable, if it was only stored on those tuples that are
(HOT) updated. But it's not clear to me what you're proposing to do with
the field, anyway, Which tuples would have it, and what would it point to?

My guess what Hannu is suggesting is to have a  circular chain of HOT-updated
tuples in a page. The index can point to any tuple in the chain. When
update goes off-page or is a COLD update, t_ctid points to the newer version
as usual. So a tuple which is COLD updated would need two pointers, one
which points to the oldest version in the circular on-page chain and other which
points to the new version.
 
Thanks,
Pavan

--

EnterpriseDB     http://www.enterprisedb.com

pgsql-hackers by date:

Previous
From: Greg Smith
Date:
Subject: Documentation on WAL/buffer cache/checkpoint internals
Next
From: "Jaime Casanova"
Date:
Subject: select from sequences