Ask the Expert

Finding unused indexes

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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: