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

From Gregory Stark
Subject Re: Proposal for Null Bitmap Optimization(for Trailing NULLs)
Date
Msg-id 87k5ndptcv.fsf@oxford.xeocode.com
Whole thread Raw
In response to Proposal for Null Bitmap Optimization(for Trailing NULLs)  ("Gokulakannan Somasundaram" <gokul007@gmail.com>)
Responses Re: Proposal for Null Bitmap Optimization(for Trailing NULLs)  ("Gokulakannan Somasundaram" <gokul007@gmail.com>)
Re: Proposal for Null Bitmap Optimization(for Trailing NULLs)  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
"Gokulakannan Somasundaram" <gokul007@gmail.com> writes:

> a) By modifying the functions, heap_form_tuple and heap_fill_tuple, we can
> check whether all the nulls are trailing nulls. If all the nulls are
> trailing nulls, then we will not set the has_null flag and we will not have
> the null bitmap with the tuple.

I think that would work. The only question is whether it's worth bothering
since we would have to check it on every heap_form_tuple. But I suspect it
might be possible to do it pretty cheaply or perhaps even for free. The extra
complexity would be pretty localized so I don't think that's a big downside.

> b) While selecting the tuple, we will check whether the tuple offset equals
> / exceeds the length of the tuple and then mark the remaining attributes of
> the tuple as null. To be exact, we need to modify the slot_deform_tuple in
> order to achieve the same.

Actually this already works. *_deform_tuple has to be able to deal with tables
to which people have added columns. In that case tuples inserted before the
columns were added will look just as you describe, with trailing columns
missing. 


--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Get trained by Bruce Momjian - ask me about
EnterpriseDB'sPostgreSQL training!
 


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: WORM and Read Only Tables (v0.1)
Next
From: Simon Riggs
Date:
Subject: Re: Proposal for Null Bitmap Optimization(for Trailing NULLs)