SQL Server 2008, how much space does this lesson take?

I am trying to calculate how much space (MB) it will take. The database table has 7 bit columns, 2 tiny ints and 1 guid.

Trying to calculate the amount that will occupy 16,000 lines.

My thought was that 7-bit columns consume 1 byte, 2 tiny ints consume 2 bytes, and guid consumes 16 bytes. Only 19 bytes per row in the table? That would mean 304,000 bytes for 16,000 lines or ~ 0.3mbs of us, what is right? Is there a metadata byte?

+4
source share
1 answer

There are several ratings out there that take away the donkey's job.

You should consider the Null bitmap, which in this case will be 3 bytes + the number of lines per page + line header + line + pointers + everything here:

Inside the storage engine: recording anatomy

Edit:

Your 19 bytes of actual data

  • has 11 byte overhead
  • only 30 bytes per line
  • about 269 lines per page (8096/30)
  • 60 pages required (16000/269)
  • about 490 thousand spaces (60 x 8192)

  • several KB for the primary index structure

+6
source

Source: https://habr.com/ru/post/1334496/


All Articles