Re: HOT for PostgreSQL 8.3

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: mark(at)mark(dot)mielke(dot)cc
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Hannu Krosing <hannu(at)skype(dot)net>, 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 17:23:30
Message-ID: 45D0A292.5040208@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

mark(at)mark(dot)mielke(dot)cc wrote:
> On Mon, Feb 12, 2007 at 12:48:06AM -0500, Tom Lane wrote:
>> We just finished sweating blood to get the tuple header size down to 23
>> bytes from 27 (which saves 8 bytes not 4 if MAXALIGN=8). We are not
>> going to blow that again on HOT.
>
> I haven't had enough time to follow all of the details here - but if the
> ability to update a row with minimal overhead, as long as there is extra
> room in the same block is a great idea (it sounds appealing to me) - could
> it be done with just a 1 byte list? 24 instead of 23 for the tuple size.

Assuming 8k pages, you could in theory store reference to a line pointer
in just 1 byte.

But actually that 1 free byte in the header is not currently just waste
of space. If you have any nulls in your tuple, there's going to be a
null bitmap in addition to the header. 1 byte is conveniently enough to
store the null bitmap for a table with max 8 columns, and if a table has
more than 8 columns, the extra 4 or 8 bytes needed for the null bitmap
probably doesn't matter so much because the tuples are quite wide anyway.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Weslee Bilodeau 2007-02-12 17:27:11 Re: Acclerating INSERT/UPDATE using UPS
Previous Message Heikki Linnakangas 2007-02-12 16:26:24 Re: DROP DATABASE and prepared xacts