SQLUSA

Microsoft SQL Server 2005 Best Practices

How to see if index is deteriorated?

 

Inserts, updates, and deletes spoil indexes which start out good after create index or reindex.

Use the following DBCC command to check the state of an index:

dbcc showcontig(TableX) with all_indexes

Results:

LEAF level scan performed.
- Pages Scanned................................: 22329
- Extents Scanned..............................: 2804
- Extent Switches..............................: 2804
- Avg. Pages per Extent........................: 8.0
- Scan Density [Best Count:Actual Count].......: 99.54% [2792:2805]
- Logical Scan Fragmentation ..................: 12.56%
- Extent Scan Fragmentation ...................: 3.28%
- Avg. Bytes Free per Page.....................: 2146.7
- Avg. Page Density (full).....................: 89.77%

The fragmentation is 12.56%, in the tolerable range.

 

Best in the World in SQL Server Training
 
SQLUSA.com Home Page