我正在使用SQL Server 2005.本表中剩餘空間在哪裏?
我有一個表的行大小應該是124個字節。這是所有整數或浮點數,沒有NULL列(所以一切都是固定的寬度)。
只有一個索引聚集在一起。填充因子是0。
這裏的DEF表:
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)
插入噸的數據,註釋sp_spaceused返回以下
name rows reserved data index_size unused
OHLC_Bar_Trl 117076054 29807664 KB 29711624 KB 92344 KB 3696 KB
其示出大約的ROWSIZE(29807664 * 1024後)/ 117076054 = 260字節/行。
剩下的空間在哪裏?
是否需要運行一些DBCC命令來收緊此表(我無法以正確的索引順序插入行,因此可能只是內部碎片)?
如果您顯示實際的列和鍵(例如,您的聚簇索引是否在唯一的單列主鍵上?) – Aaronaught 2010-06-07 14:01:04
添加了表def ..... – 2010-06-07 15:16:16