I want to find out the unused indexes on a particular table, because most of the indexes are not used by the queries which are written based on the indexes.

    Requires Free Membership to View

First, query the Data Dictionary to find all indexes on that table:
SELECT index_name FROM user_indexes WHERE table_name='EMP';
For all indexes that are returned, issue the following:
ALTER INDEX index_name MONITORING USAGE;
After exercising your application, query the V$OBJECT_USAGE view. The USED column of this view will contain YES if the index was used; otherwise, it will contain NO. This will tell you if the index has ever been used since the MONITORING USAGE command was last given.

If you are not using indexes, drop them. When done, you can turn off monitoring with the following:

ALTER INDEX index_name NOMONITORING USAGE;

This was first published in September 2006

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.