|
-
Apr 13th, 2010, 03:50 AM
#1
Thread Starter
Lively Member
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.
-
Apr 14th, 2010, 10:45 AM
#2
Thread Starter
Lively Member
-
Apr 14th, 2010, 02:46 PM
#3
Lively Member
Re: Query Index
If you look at the expanded query you'll see there are different index levels
I wrote a book  Visual Studio 2008 Programming
Amazon.com / Visual Studio 2008 Programming / By Jamie Plenderleith & Steve Bunn
-
Apr 15th, 2010, 05:08 AM
#4
Thread Starter
Lively Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|