Perry Whittle (1/6/2014)
What command did you use to check the frags?
Can you post the before and after outputs?
To obtain the fragmentation I made the following query:
, o.name TableName
, i.name IndexName
FROM sys.dm_db_index_physical_stats (
DB_ID (N'DBNAME'), NULL, NULL, NULL, 'LIMITED'
INNER JOIN sys.sysobjects o ON o.id = ips.object_id
INNER JOIN sys.indexes i ON i.index_id = ips.index_id AND o.id = i.object_id
avg_fragmentation_in_percent > 0*/
Results were 138 rows, not all of them indexes, some of the tables are heaps. Of all those only 6 indexes/heaps were affected and those are the ones I rebuild.
index_type_desc - avg_fragmentation_in_percent BEFORE SHRINKING - avg_fragmentation_in_percent AFTER SHRINKING
HEAP - 82.25108225 - 98.04347826
HEAP - 61.20271341 - 84.08010694
HEAP - 12.16216216 - 92.95774648
CLUSTERED INDEX - 0.01 - 91.85990864
NONCLUSTERED INDEX - 1.99556541 - 2.2172949
HEAP - 14.51824626 - 99.81283422