jir*_*ec2 5 database sql-server sql-server-2008 sqldatatypes
我在共享主机上有一个MS SQL Server 2008数据库,我需要尽可能减少使用的存储空间.我最大的表有以下定义:
CREATE TABLE [stage](
[station_id] [smallint] NOT NULL,
[time_utc] [smalldatetime] NOT NULL,
[stage_mm] [smallint] NOT NULL,
CONSTRAINT [PK_stage] PRIMARY KEY CLUSTERED ([station_id] ASC,[time_utc] ASC)
Run Code Online (Sandbox Code Playgroud)
我试图找出表中每条记录的平均字节数.根据理论,大小应为:4B(行标题)+ 2B(smallint)+ 4B(smalldatetime)+ 2B(smallint),即12字节.
但是,当我运行命令时:
dbcc showcontig ('stage') with tableresults
Run Code Online (Sandbox Code Playgroud)
它显示:MinimumRecordSize = 15,MaximumRecordSize = 15因此根据SQL Server,每条记录的字节数为15而不是12当我查看表占用的总磁盘空间并将其除以时,每条记录的15字节数似乎也是正确的.行数.
占用3个额外字节的是什么?
归档时间: |
|
查看次数: |
2464 次 |
最近记录: |