Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] Proposal for Null Bitmap Optimization(for TrailingNULLs)

From: "Gokulakannan Somasundaram" <gokul007(at)gmail(dot)com>
To: Decibel! <decibel(at)decibel(dot)org>
Cc: "pgsql-hackers list" <pgsql-hackers(at)postgresql(dot)org>, pgsql-patches(at)postgresql(dot)org, "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Simon Riggs" <simon(at)2ndquadrant(dot)com>, "Gregory Stark" <stark(at)enterprisedb(dot)com>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Subject: Re: [HACKERS] Proposal for Null Bitmap Optimization(for TrailingNULLs)
Date: 2007-12-25 18:04:38
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-patches
    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(at)decibel(dot)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

> 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.

CertoSQL Project,
Allied Solution Group.

In response to

pgsql-hackers by date

Next:From: Andreas 'ads' ScherbaumDate: 2007-12-25 22:21:41
Subject: Re: Binary data type with other output method
Previous:From: imadDate: 2007-12-25 17:12:23
Subject: Re: Binary data type with other output method

pgsql-patches by date

Next:From: Hans-Juergen SchoenigDate: 2007-12-27 08:37:19
Subject: CONNECT BY for 8.3 ...
Previous:From: Decibel!Date: 2007-12-24 20:50:37
Subject: Re: Proposed patch to disallow password=foo in database name parameter

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group