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


Index Utilization Summary Report Script


Index Utilization Summary Report Script

Author
Message
yusufkahveci
yusufkahveci
SSC Veteran
SSC Veteran (230 reputation)SSC Veteran (230 reputation)SSC Veteran (230 reputation)SSC Veteran (230 reputation)SSC Veteran (230 reputation)SSC Veteran (230 reputation)SSC Veteran (230 reputation)SSC Veteran (230 reputation)

Group: General Forum Members
Points: 230 Visits: 649
Comments posted to this topic are about the item Index Utilization Summary Report Script

SQL Server Consultant
yusufkahveci@sqlturkiye.com
www.sqlturkiye.com
Lee Linares
Lee Linares
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2119 Visits: 1647
Yusuf,
Thank you for sharing this script. However I ran into to some problems where it returned way too many rows. The issue is that sys.indexes and sys.objects are database system objects but sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats cover the entire instance.
So you can have an object_id appear in multiple databases. I believe the query would need additional conditions in the WHERE clause. Something like:

AND IUS.database_id= DB_ID()
AND IOS.database_id= DB_ID()

That restricts the output to just the current database.

Thank you again for sharing the script.

Lee
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