Re: IndexTuple Structure

From: "Gokulakannan Somasundaram" <gokul007(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: IndexTuple Structure
Date: 2007-10-09 10:38:00
Message-ID: 9362e74e0710090338x578d770bla84736e1b376101c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/9/07, Gokulakannan Somasundaram <gokul007(at)gmail(dot)com> wrote:
>
> Hi,
> When i saw the IndexTuple structure, i saw that 13 bits are allocated
> to store the size of the Values List of the IndexTuple Structure. Also the
> IID(ItemId Identifier) in the Page header stores the complete size of the
> IndexTuple. Can't we derive the size of the IndexTuple from the IID->len?
> I think we will be able to save 1 byte per IndexTuple, if we can
> implement this from t_info.
>
> But will this really be a benefit, if we reduce this, considering the
> effect of MAX_ALIGN?
> I did a small analysis, Currently IndexTuple has a ItemId (6 Bytes) +
> t_info(2 Bytes) . So usually it is 8 Bytes. In this case it doesn't matter
> whether the t_info occupies 1 byte/2 bytes.
> But when Null Bitmap is included and if it is less than one byte(which it
> is in most of the cases), then IndexInfoFindDataOffset will return 12 bytes
> now (9 bytes + 3 bytes for maxalign).
> If we make this improvement, it will continue to be 8 bytes(saving of 4
> bytes per IndexTuple)

No the calculation went wrong over here. It occupies 12 bytes, if the null
bitmap exists, since the null bitmap is always 4 bytes.

Please put forth your comments..
>
>
> Thanks,
> Gokul.
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Csaba Nagy 2007-10-09 11:04:52 Re: Including Snapshot Info with Indexes
Previous Message Simon Riggs 2007-10-09 10:35:59 Uninformative messages from pg_ctl