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

From Gokulakannan Somasundaram
Subject Re: Proposal for Null Bitmap Optimization(for Trailing NULLs)
Date
Msg-id 9362e74e0803251236s673b5a70kff1a9262f581dbd1@mail.gmail.com
Whole thread Raw
In response to Re: Proposal for Null Bitmap Optimization(for Trailing NULLs)  ("Gokulakannan Somasundaram" <gokul007@gmail.com>)
List pgsql-hackers
Hi,
    As said, i am attaching the performance test results and the same patch in this thread works with the latest CVS head.
Actually, i am seeing a slight performance improvement with the patch, which i think might be either because of noise/ lesser pages. i ran it with the default settings.  i have tested only inserts and selects, because that's where the code change has happened.

Regarding Tom's comments....
As far as the changes are concerned, the patch changes the following functions
a) heap_fill_tuple
b) nocachegetattr
c) heap_form_tuple
d) index_form_tuple
e) nocache_index_getattr
f) changed the macros index_getattr, IndexTupleSize, IndexTupleDSize
g) Introduced a new macro IndexTupleActualSize


The patch introduces the following changes to the storage of tuples
1) If there are only trailing nulls, it doesn't store the null bitmap
2) If there are non-trailing nulls and trailing nulls, it stores the null-bitmap only till the last non-null value. so it decreases the storage requirement of null bitmap. This is expected to have only very few use-cases
3) It doesn't store the null-bitmap for trailing nulls in indexes also

The functions mentioned in d), e), f), g) are required for the functionality of index null-bitmap handling. I suppose, we can't handle it with only heap_form_tuple. Please correct me, if i am wrong..

For having the functionality 2), we have to touch the heap_fill_tuple. i have done the trick, by asking it to use the passed number of attributes, instead of taking it from tupdesc.  Again please advice me on how to implement this with only heap_form_tuple.

Looking forward for comments/suggestions.....

Thanks,
Gokul.


Attachment

pgsql-hackers by date:

Previous
From: Neil Conway
Date:
Subject: Re: Idea for minor tstore optimization
Next
From: Tom Lane
Date:
Subject: Re: gcc 4.3 breaks ContribCheck in 8.2 and older.