25 June,2007 by Tom Collins
Use this T-SQL Script to retrieve SQL indexes that haven't been used. For a wider view on table and index usage read SQL Server – Find last time of update on a table
select object_name(object_id), index_id, user_seeks, user_scans, user_lookups from sys.dm_db_index_usage_stats order by object_id, index_id ---All indexes which haven’t been used yet can be retrieved with the following statement: select object_name(object_id), i.name from sys.indexes i where i.index_id NOT IN (select s.index_id from sys.dm_db_index_usage_stats s where s.object_id=i.object_id and i.index_id=s.index_id and database_id = DB_id(db_name())) order by object_name(object_id) asc
Top 5 SQL Server DMV for Index Analysis
List all indexes of all tables
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |