x

Size of the NULL bitmap

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.

Can anyone confirm / deny?
more ▼

asked Apr 21, 2011 at 02:04 AM in Default

Matt Whitfield gravatar image

Matt Whitfield ♦♦
29.4k 61 65 87

I'm sure Klaus covered this in his talk at SQLBits... but I can't remember
Apr 21, 2011 at 02:20 AM ThomasRushton ♦
(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

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][2]

[2]: http://msdn.microsoft.com/en-us/library/ms178085.aspx
more ▼

answered Apr 21, 2011 at 02:47 AM

Pavel Pawlowski gravatar image

Pavel Pawlowski
22.3k 9 11 21

Awesome, cheers - was clearly having an information finding fail day :)
Apr 21, 2011 at 05:12 AM Matt Whitfield ♦♦
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x30
x13

asked: Apr 21, 2011 at 02:04 AM

Seen: 1937 times

Last Updated: Apr 21, 2011 at 02:04 AM