Proposal for Byte savings in VarBit structure - Mailing list pgsql-hackers

From Gokulakannan Somasundaram
Subject Proposal for Byte savings in VarBit structure
Date
Msg-id 9362e74e1003211236nd6a4f84h479ec95f52b94f44@mail.gmail.com
Whole thread Raw
Responses Re: Proposal for Byte savings in VarBit structure
List pgsql-hackers
Hi,<br />   I was looking at the VarBit data structure and found out that instead of storing the number of bits in four
bytes,we can save the number of bits that are valid in the last byte. Since we already store the number of bytes in
VarlenaHeader, we can calculate the number of valid bits by doing the small math. ( (No. of bytes-1) * 8  + valid bits
inthe last byte).<br />   This would save atleast 8 bytes for someone, who is using the varbit data type using less
than24 bits.<br /><br />  Waiting for comments.<br /><br />Thanks,<br />Gokul.<br /> 

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: proposal: more practical view on function's source code
Next
From: Tom Lane
Date:
Subject: Re: Proposal for Byte savings in VarBit structure