码迷,mamicode.com
首页 > 数据库 > 详细

SQL------查看索引大小

时间:2020-11-25 12:21:37      阅读:11      评论:0      收藏:0      [点我收藏+]

标签:object   名称   name   rom   object_id   obj   nbsp   page   partition   

如下

SELECT
  i.name AS [索引名称],
  SUM(s.used_page_count) * 8 AS [索引大小KB]
FROM sys.dm_db_partition_stats  AS s 
JOIN sys.indexes AS i
ON s.[object_id] = i.[object_id] AND s.index_id = i.index_id
WHERE s.[object_id] = object_id(FenZhongJiaGe) 
GROUP BY i.name
ORDER BY i.name

 

SQL------查看索引大小

标签:object   名称   name   rom   object_id   obj   nbsp   page   partition   

原文地址:https://www.cnblogs.com/fabao/p/14015027.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!