Re: HOT for PostgreSQL 8.3

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Hannu Krosing <hannu(at)skype(dot)net>
Cc: 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-11 23:13:45
Message-ID: 45CFA329.8030008@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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?

As long as the index points to any tuple in the update chain, an index
scan can even scan the whole page to find all the earlier tuples in the
chain. The latest version can always be found by following the c_tid
pointers, so that would only be needed to find an older version of the row.

> How about adding a new 2-byte field to header for in-page c_tid poiner
> for HOT ?
>
> It grows header from 26 to 28 bytes, but for MAXALIGN=4 the space usage
> would stay the same.

Actually the tuple header is now 23 bytes, thanks to combo (aka phantom)
cids. Adding a new 2-byte field would take it over 24 bytes again,
making it either 28 or 32 bytes depending on MAXALIGN.

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?

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message D'Arcy J.M. Cain 2007-02-11 23:37:00 Re: Ooops ... seems we need a re-release pronto
Previous Message Cristiano Panvel 2007-02-11 22:56:49 Re: PostgreSQL and OpenLdap