|
Posted by smithabreddy on 06/09/06 12:52
Have you checked the fillfactor defined for these indexes?
(use sys.indexes to get this information)
wackyphill@yahoo.com wrote:
> After rebuilding an index, it still shows as the same amount of
> fragmentation. ANy ideas what's wrong?
>
> I'm determining which indexes to rebuild using the following query:
>
> SELECT
> OBJECT_NAME(i.object_id) AS TableName,
> i.name AS IndexName,
> ips.avg_fragmentation_in_percent
> FROM sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL, NULL,
> 'DETAILED') ips
> JOIN sys.indexes i ON
> i.object_id = ips.object_id
> AND i.index_id = ips.index_id
> WHERE ips.avg_fragmentation_in_percent > 10
>
> (I know 10% is not enough where a full rebuild is called for, just
> wanted to see my fragmentation)
>
> Then I rebuild w/:
>
> ALTER INDEX IX_CustomerName ON Customers REBUILD
>
> When I rerun the 1st query the same amount of fragmentation is shown
> as before the rebuild. I'd appreciate any help.
[Back to original message]
|