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.o bject_id) AS TableName,
i.name AS IndexName,
ips.avg_fragmen tation_in_perce nt
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_fragmen tation_in_perce nt > 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.
fragmentation. ANy ideas what's wrong?
I'm determining which indexes to rebuild using the following query:
SELECT
OBJECT_NAME(i.o bject_id) AS TableName,
i.name AS IndexName,
ips.avg_fragmen tation_in_perce nt
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_fragmen tation_in_perce nt > 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.
Comment