Indexes

Last Post 20 Apr 2009 01:04 PM by sql-tips. 1 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
sql-tips
New Member
New Member

--
20 Apr 2009 07:26 AM
I have a large table which has 10 indexes created, these indexes created over the period of time may be last 15 years. Now I need to identity which indexes are unused, so that I can drop them.
sql-tips
New Member
New Member

--
20 Apr 2009 01:04 PM
Thanks rm. I have table with 9 indexes. But when I ran from dm_db_index_usage_stats that object Id it shows only 5 indexes.

select * from sys.dm_db_index_usage_stats
where object_id = 20271

Why it is not showing other 4 indexes.

Also, last_user_seek and last_user_scan columns are null what is this means?. I used following query.

select i.object_id,o.name,i.index_id,ind.name Index_Name,i.*
from sys.dm_db_index_usage_stats i, sys.objects o,sys.indexes ind
where i.object_id = o.object_id
and o.object_id = 20271
and ind.object_id = o.object_id
and i.index_id = ind.index_id
You are not authorized to post a reply.

Acceptable Use Policy