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

sql server 索引分析相关sql

时间:2015-12-25 15:14:44      阅读:188      评论:0      收藏:0      [点我收藏+]

标签:

select object_id(‘dbo.FT_CFP_TRADE_SUBACCOUNT‘)

select * from sys.partitions where [object_id]=1467256382

select * from sys.allocation_units where container_id=72057594139049984

select * from sys.system_internals_allocation_units where container_id=72057594139049984
SELECT * FROM sys.dm_db_index_physical_stats(db_id(),object_id(‘dbo.MM_RealQuoteHistory_11‘),null,null,‘sampled‘)
SELECT * FROM sys.dm_db_index_physical_stats(db_id(),object_id(‘dbo.MM_RealQuoteHistory_11‘),null,null,‘DETAILED‘)

SELECT object_name(a.object_id) [TableName] ,a.index_id ,name [IndexName] ,avg_fragmentation_in_percent,
a.*,b.*
FROM sys.dm_db_index_physical_stats ( DB_ID() , NULL , NULL, NULL, NULL ) AS a
JOIN sys.indexes AS b ON a.object_id = b.object_id AND a.index_id = b.index_id

dbcc SHOWCONTIG (‘dbo.MM_RealQuoteHistory_11‘)

sql server 索引分析相关sql

标签:

原文地址:http://www.cnblogs.com/hongb/p/5075863.html

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