遗忘海岸

江湖程序员 -Feiph(LM战士)

导航

查看数据表的内外碎片情况

View Code
use DBName
go
select page_count,avg_page_space_used_in_percent,
record_count,avg_record_size_in_bytes,avg_fragmentation_in_percent,
fragment_count
from sys.dm_db_index_physical_stats
(DB_ID('DBName'),OBJECT_ID('TableName'),NULL,NULL,'sampled')

DBCC ShowContig(TableName)

查看索引的碎片情况

dbcc showcontig('tableName','IndexName')
参考
http://www.cnblogs.com/petitprince/archive/2009/10/23/1588603.html

posted on 2013-03-18 15:15  遗忘海岸  阅读(300)  评论(0编辑  收藏  举报