相关疑难解决方法(0)

sys.allocation_units 和 sp_spaceused 上的空间使用情况

众所周知,DMV 不保存有关页数和行数的准确信息。但是,当您更新统计数据时,我不明白为什么他们不会。

我正在开发一个监控工具,想知道每个索引和数据的磁盘大小等。最终我想找到合适的填充因子,以及其他一些东西。

The space used by my function and the old sp_spaceused differs a little bit on the space usage, but not on record count.

Can you see if there is anything missing in my select?

this is the sp_spaceused (then I convert the numbers in MB):

sp_spaceused 'tblBOrderRelationship'
go

select 318008/1024.00 AS reserved,
140208/1024.00  AS data,
177048/1024.00 AS index_size,
752/1024.00    AS unused
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

But when I run my select, code below\picture below, I get slightly different figures.

SET TRANSACTION …
Run Code Online (Sandbox Code Playgroud)

index sql-server dmv disk-space

14
推荐指数
2
解决办法
6617
查看次数

标签 统计

disk-space ×1

dmv ×1

index ×1

sql-server ×1