Note that there are some explanatory texts on larger screens.

plurals
  1. POWhere's the rest of the space used in this table?
    primarykey
    data
    text
    <p>I'm using SQL Server 2005.</p> <p>I have a table whose row size should be 124 bytes. It's all ints or floats, no NULL columns (so everything is fixed width).</p> <p>There is only one index, clustered. The fill factor is 0.</p> <p>Here's the table def:</p> <pre><code>create table OHLC_Bar_Trl ( obt_obh_id int NOT NULL REFERENCES OHLC_Bar_Hdr (obh_id), obt_bar_start_ms int NOT NULL, obt_bar_end_ms int NOT NULL, obt_last_price float NOT NULL, obt_last_ms int NOT NULL, obt_bid_price float NOT NULL, obt_bid_size int NOT NULL, obt_bid_ms int NOT NULL, obt_bid_pexch_price float NOT NULL, obt_ask_price float NOT NULL, obt_ask_size int NOT NULL, obt_ask_ms int NOT NULL, obt_ask_pexch_price float NOT NULL, obt_open_price float NOT NULL, obt_open_ms INT NOT NULL, obt_high_price float NOT NULL, obt_high_ms INT NOT NULL, obt_low_price float NOT NULL, obt_low_ms INT NOT NULL, obt_volume float NOT NULL, obt_vwap float NOT NULL ) go create unique clustered index idx on OHLC_Bar_Trl (obt_obh_id,obt_bar_end_ms) </code></pre> <p>After inserting a ton of data, sp_spaceused returns the following</p> <pre><code>name rows reserved data index_size unused OHLC_Bar_Trl 117076054 29807664 KB 29711624 KB 92344 KB 3696 KB </code></pre> <p>which shows a rowsize of approx (29807664*1024)/117076054 = 260 bytes/row.</p> <p>Where's the rest of the space?</p> <p>Is there some DBCC command I need to run to tighten up this table (I could not insert the rows in correct index order, so maybe it's just internal fragmentation)?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload