cancel
Showing results for 
Search instead for 
Did you mean: 

Index used by Cost-based optimizer

Former Member
0 Kudos
2,344

Hello,

Does anyone know how to determine which index is used by the cost-based optimizer during query execution.

Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Your explain plan should identify the index, if one is used.

If you have access to ST04, you can see recently run SQL stmts, or if you have the SQL you should be able to run it thru ST05, or have a DBA get you the Explain Plan. If you run the query thru RSRT and check the box that says show Run Schedule, it should show you the Explain Plan as you step RSRT.

The displays of the tables in the Explain Plan should be active links and will allow you to check to see what the Last Analyzed date for the table was and can run an Analyze to refresh the stats if they are old/questionable.

Message was edited by: Pizzaman

ST04

Click on "Detail analysis menu"

Click on "SQL Request"

Enter the table name(s) in the SQL Statement Pattern

This should give you a list of recently run SQL stmts. One of the columns has the time it was run. Find the one you want to check. Click on the SQL stmt - that should open up a window that contains the formatted SQL stmt.

From there, click on the wrench icon at the bottom. That should provide the Explain Plan. That should show you how the query was run - if a table was read using a full scan or an index, and what index.