-
Query Index
Hi,
When querying index statistics against my SQL 2005 environment, I am seeing mulitple entrees for the same Index with different percentages.
I am using the following query
Code:
SELECT
OBJECT_NAME(i.object_id) AS TableName,
i.name AS TableIndexName,
phystat.avg_fragmentation_in_percent
FROM
sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL, NULL, 'DETAILED') phystat inner JOIN sys.indexes i
ON i.object_id = phystat.object_id
AND i.index_id = phystat.index_id
WHERE phystat.avg_fragmentation_in_percent > 10
order by TableName
For example i have an index called 'IX_Sales'
This index has 2 rows for 'avg_fragmentation_in_percent ', showing 15%,25%.
How can one index have two rows and how can they be different?
Thanks for any info.
-
Re: Query Index
-
Re: Query Index
If you look at the expanded query you'll see there are different index levels
-
Re: Query Index