SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Index Utilization Summary


Index Utilization Summary

Author
Message
Devendra Thakur
Devendra Thakur
SSC-Addicted
SSC-Addicted (408 reputation)SSC-Addicted (408 reputation)SSC-Addicted (408 reputation)SSC-Addicted (408 reputation)SSC-Addicted (408 reputation)SSC-Addicted (408 reputation)SSC-Addicted (408 reputation)SSC-Addicted (408 reputation)

Group: General Forum Members
Points: 408 Visits: 67
Comments posted to this topic are about the item Index Utilization Summary
Budd
Budd
Old Hand
Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)

Group: General Forum Members
Points: 308 Visits: 507
Very nice.
I needed a minor alteration.
LEFT JOIN sys.dm_db_index_operational_stats(NULL, NULL, NULL, NULL)IOS ON Indx.object_id=IOS.object_id AND Indx.index_id=IOS.index_id AND IUS.database_id=IOS.database_id
WHERE(Obj.type_desc='USER_TABLE' OR Obj.type_desc='VIEW')
AND ius.database_id = DB_ID()
Lee Linares
Lee Linares
Old Hand
Old Hand (360 reputation)Old Hand (360 reputation)Old Hand (360 reputation)Old Hand (360 reputation)Old Hand (360 reputation)Old Hand (360 reputation)Old Hand (360 reputation)Old Hand (360 reputation)

Group: General Forum Members
Points: 360 Visits: 1441
Thank you for taking the time to share this with us. I made 2 minor changes though to restrict the output to just the current database:
1. I changed this:

sys.dm_db_index_usage_stats IUS ON Indx.index_id=IUS.index_id AND IUS.object_id=Obj.object_id



to this :

sys.dm_db_index_usage_stats IUS ON Indx.index_id=IUS.index_id AND IUS.object_id=Obj.object_id AND IUS.database_id = DB_ID()

2. I changed this:

sys.dm_db_index_operational_stats (NULL,NULL,NULL,NULL )


to this:

sys.dm_db_index_operational_stats (DB_ID(),NULL,NULL,NULL )

Thanks again.

Lee
VoldemarG
VoldemarG
SSC-Enthusiastic
SSC-Enthusiastic (130 reputation)SSC-Enthusiastic (130 reputation)SSC-Enthusiastic (130 reputation)SSC-Enthusiastic (130 reputation)SSC-Enthusiastic (130 reputation)SSC-Enthusiastic (130 reputation)SSC-Enthusiastic (130 reputation)SSC-Enthusiastic (130 reputation)

Group: General Forum Members
Points: 130 Visits: 202
Question: if everything (each column) from the resultset of the original index-utilization qry
if all columns to the right of has_filter are NULLs -- does it means that the index IS NOT USED AT ALL?
also, why database id and object id would be NULL ? table listed in col 1, index name in col 3 of the result-set -- so why db id and obj id would be nulls, really?

THANK YOU SO MUCH in advance for possible dispersing of my doubts and confusions...


Vlad


Voldemar
likes to play chess
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search