Re: Proposal for Null Bitmap Optimization(for TrailingNULLs) - Mailing list pgsql-hackers

From Gokulakannan Somasundaram
Subject Re: Proposal for Null Bitmap Optimization(for TrailingNULLs)
Date
Msg-id 9362e74e0712251004p6115193dncd6e65326bdc2291@mail.gmail.com
Whole thread Raw
In response to Re: Proposal for Null Bitmap Optimization(for TrailingNULLs)  (Decibel! <decibel@decibel.org>)
List pgsql-hackers
Hi,
    Back from the holiday times. I have tried to present the proof, that the null bitmap was absent in the table with the trailing nulls.  

On Dec 22, 2007 4:43 AM, Decibel! < decibel@decibel.org> wrote:
On Dec 20, 2007, at 2:36 AM, Gokulakannan Somasundaram wrote:
> I checked it by creating a table with 10 columns on a 32 bit
> machine. i inserted 100,000 rows with trailing nulls and i observed
> savings of 400Kbytes.


That doesn't really tell us anything...
As i said that the patch removes the null bitmap, if the tuple has trailing nulls. Our tuple size without null bitmap is 23 bytes. Currently, as long as the table has less than 8 columns(with null), the heaptuple header size will be 24 bytes. But if the tuple has more than 8 columns, then it will occupy 4 more bytes in a 32 bit system and 8 more bytes in a 64 bit system. This patch attempts to save that extra space, if the tuple has only trailing nulls
 
how big was the table
originally?
I think it was 5.5 M and 5.1M before and after applying the patch. But how is this relevant? The patch saves 4 bytes in a 32 bit system per tuple, irrespective of the size of the tuple
 
Also, testing on 64 bit would be interesting.
I tested the patch on 64 bit system also for regression. The saving was 8 bytes per tuple.

I have attempted to provide an explanation. But i don't know whether i have answered your doubts exactly.
Please revert back, in case you haven't got clarified.



--
Thanks,
Gokul.
CertoSQL Project,
Allied Solution Group.
( www.alliedgroups.com)

pgsql-hackers by date:

Previous
From: imad
Date:
Subject: Re: Binary data type with other output method
Next
From: Andreas 'ads' Scherbaum
Date:
Subject: Re: Binary data type with other output method