当前位置: 代码迷 >> SQL >> sql server 目录分析相关sql
  详细解决方案

sql server 目录分析相关sql

热度:160   发布时间:2016-05-05 09:44:42.0
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')

  相关解决方案