Re: HOT for PostgreSQL 8.3

From: "Pavan Deolasee" <pavan(dot)deolasee(at)gmail(dot)com>
To: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
Cc: "Hannu Krosing" <hannu(at)skype(dot)net>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Simon Riggs" <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org, "Pavan Deolasee" <pavan(dot)deolasee(at)enterprisedb(dot)com>, "Nikhil S" <nikhil(dot)sontakke(at)enterprisedb(dot)com>
Subject: Re: HOT for PostgreSQL 8.3
Date: 2007-02-12 03:54:19
Message-ID: 2e78013d0702111954p6e6054f2s8ab11701c0de0ac@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2/12/07, Heikki Linnakangas <heikki(at)enterprisedb(dot)com> wrote:
>
> Hannu Krosing wrote:
> > Ühel kenal päeval, P, 2007-02-11 kell 12:35, kirjutas Tom Lane:
> >> Hannu Krosing <hannu(at)skype(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jaime Casanova 2007-02-12 03:58:07 select from sequences
Previous Message Greg Smith 2007-02-12 02:21:44 Documentation on WAL/buffer cache/checkpoint internals