Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15694

Missing bytes

$
0
0

If I have the following table with 51800000 rows and avg page space used of 99.79%. Why does the table use 1025792 KB?

CREATE TABLE [FactVaR_S265_K1_K1]
([Factor Group Key] [TINYINT] NOT NULL, -- 1 byte
[Scenario Key] [SMALLINT] NOT NULL, -- 2 bytes
[Trade Key] [INT] NOT NULL, -- 4 bytes
[VaR PV Change] [REAL] NOT NULL) -- 4 bytes

GO

Each record consumes 18 bytes as follows:

------------------------------------------------------------------------------------------------------------
|Status bits A | Status bits A | Length of fixed Length data | Fixed Length Data| No. columns| NULL bit map|
------------------------------------------------------------------------------------------------------------
| 1 byte | 1 byte | 2 bytes | 11 bytes | 2 bytes | 1 byte |
------------------------------------------------------------------------------------------------------------

My calculations for the space used would be as follows:

(Rows * bytes)/1024 
(51800000 * 18)/1024 = 910547

I then know the data is stored on 128224 pages which gives us header plus row offset

128224 * (96 + 36) = 16925568/1024 = 16528 KB

So data and page info is 16528 KB + 910547 KB = 927075 KB

This leaves us Used space 1025792 KB - 927075 KB = 98716KB Lost space. Thats nearly 10% unaccounted for.
 

Does anyone have any suggestions where this space might be accounted for?

Thanks,

Jamie.


Viewing all articles
Browse latest Browse all 15694

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>