3

Could anyone provide instructions on how will I check or verify if the index I created is being used in the query? Thank you.

1
  • Is there a similar question on SO for MySQL db? Dec 20, 2013 at 7:49

4 Answers 4

5

After "explain plan for" you'll want something like this:

select * from table(dbms_xplan.display);

Read this:

2
  • Is there a similar question on SO for MySQL db? Dec 20, 2013 at 7:50
  • 1
    @SandeepanNath If you visit the links above, you'll find a box labeled "This Page for" and then there is also MySQL listed. Just click there, then you'll be at the same content, just for MySQL. Dec 20, 2013 at 8:52
3

Use the following setting and then execute the query for the session.

   Set Autotrace on;

I see that you are using sqldeveloper. When you execute the after setting the autotrace on, the script output window will show the explain plan and the statistics while the query result window will show your output. The explain plan would let you know if the index was used or not for the query executed.

2

I believe in oracle you can use

EXPLAIN PLAN for sql

It should outline for you which index is being used, if any.

1
  • 1
    I executed the above code it just says "Explained"..Where will I checked the result? Sep 28, 2012 at 3:46
0

If this is in SQLDeveloper, highlight the query and click the "Autotrace" button. Usually, the F6 button corresponds to this action.

SQLDeveloper Autotrace Button

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.