sql server 索引分析相关sql

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')

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