Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Is it wise to create/drop indexes in live system when doing performance tuning?

user12240205Feb 5 2016 — edited Feb 10 2016

According to this video of John Watson

Oracle SQL Tuning - How to Read Execution Plans (Explain ...

pastedImage_0.jpg▶ 13:39

https://www.youtube.com/watch?v=bcVbR_FPWKk

Apr 7, 2014 - Uploaded by SkillBuilders

In this free tutorial you will learn how to generate and read(interpret) an execution plan in Oracle Databases ...

I watched just now, it seems even Autotrace will not give the correct plan used to execute a query.

I thought with Autotrace, the query is actually executed and the plan we are shown AFTER execution, was the actual plan used.

Why show a different plan, AFTER executing the query??

But looks like to get the ACTUAL plan, we have to, it seems, execute the SQL with hint GATHER_PLAN_STATISTICS and

use function DBMS_XPLAN.DISPLAY_CURSOR get the actual plan from the library cache of the shared pool.

Why is this???

Also, we are supposed to start a tuning of 11 huge SQLs in a production system. What if we need to create new indexes, or drop existing ones in order to make the SQLs faster.

Is it wise to play-around with the live system by creating and dropping indexes in the live system? Or, should we replicate the live system in our own machines and do the tuning there?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 9 2016
Added on Feb 5 2016
21 comments
5,439 views