on 2005 Aug 03 4:24 PM
Hello,
Does anyone know how to determine which index is used by the cost-based optimizer during query execution.
Thanks.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
69 | |
11 | |
10 | |
10 | |
9 | |
7 | |
7 | |
7 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.