When working out the storage requirements on a per-row basis, how is the size of the NULL bitmap determined?
I know that there are CEILING(n / 8) bytes of NULL bitmap per n columns - but what I don't know is whether there are always two column count bytes or not.
CEILING(n / 8)
Can anyone confirm / deny?
Apr 21, 2011 at 02:04 AM
Matt Whitfield ♦♦
I'm sure Klaus covered this in his talk at SQLBits... but I can't remember
According the MSDN, there are the 2 bytes alwas: Null_Bitmap = 2 + ((Num_Cols + 7) / 8)
Estimating the Size of a Heap
Estimating the Size of a Clustered Index
Apr 21, 2011 at 02:47 AM
Awesome, cheers - was clearly having an information finding fail day :)
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
Once you sign in you will be able to subscribe for any updates here
Answers and Comments
Need long-form SQL discussion? SQLserverCentral.com is the place.
asked: Apr 21, 2011 at 02:04 AM
Seen: 2189 times
Last Updated: Apr 21, 2011 at 02:04 AM
Does a persisted computed column need to be deterministic?
How Data is stored inside SQL Server? What order is it stored?
What counters should I baseline before moving to a SAN?
Changing a Text datatype to XML, what are the impacts on log shipping
could not allocate space but 2nd file has enough space
SQL Server cluster with shared storage
Asking for storage and SQL Server: how and what to do
LOB data on a different filegroup - performance issues/gains?
SSIS Buffers, Synchronous Transforms and Estimated Row Size
SQL Server to store article