Thursday, May 29, 2014

How to tell which Indexes are not being used?

I will have to assume that each customer has its own database or at least its own tables, because else will not be possible.


The place to looking is sys.dm_db_index_usage_stats. If you find tables with zeros in user_scans, user_seeks, user_lookups, but high values user_updates you know have a useless index which takes up resources.


Beware though, that the numbers are since the most recent restart of SQL Server, so if SQL Server was started this month, you may not see indexes used for end-of-the-month reporting.





Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

No comments:

Post a Comment