SQL Server 2008, how much space does this occupy?

前端 未结 1 1153
清歌不尽
清歌不尽 2021-01-13 19:02

I am trying to calculate how much space (Mb) this would occupy. In the database table there is 7 bit columns, 2 tiny int and 1 guid.

Trying to calculate the amount t

相关标签:
1条回答
  • 2021-01-13 20:06

    There are several estimators out there which take away the donkey work

    You have to take into account the Null bitmap which will be 3 bytes in this case + number of rows per page + row header + row version + pointers + all the stuff here:

    Inside the Storage Engine: Anatomy of a record

    Edit:

    Your 19 bytes of actual data

    • has 11 bytes overhead
    • total 30 bytes per row
    • around 269 rows per page (8096 / 30)
    • requires 60 pages (16000 / 269)
    • around 490k space (60 x 8192)

    • a few KB for the index structure of the primary

    0 讨论(0)
提交回复
热议问题