Friday, 25 March 2011

Rebuilding indexes in SQL Server

DBCC SHOWCONTIG ("dbo.TableName") - Check your Scan Density...

DBCC SHOWCONTIG scanning TableName table...
Table: TableName (2099048); index ID: 1, database ID: 5
TABLE level scan performed.
- Pages Scanned................................: 74056
- Extents Scanned..............................: 9259
- Extent Switches..............................: 9258
- Avg. Pages per Extent........................: 8.0
- Scan Density [Best Count:Actual Count].......: 99.98% [9257:9259]
- Logical Scan Fragmentation ..................: 0.01%
- Extent Scan Fragmentation ...................: 1.57%
- Avg. Bytes Free per Page.....................: 45.7
- Avg. Page Density (full).....................: 99.44%
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

Then rebuld if you need

DBCC DBREINDEX ("dbo.TableName")

No comments:

Post a Comment

Android mediaserver process killing battery life

If this happens to you, then do the following Force stop on Settings, Applications, All, Media Storage. Clear Cache and Clear Data, fo...