|
|
Re: doubt about explain plan [message #363330 is a reply to message #363216] |
Fri, 05 December 2008 18:35   |
rleishman
Messages: 3728 Registered: October 2005 Location: Melbourne, Australia
|
Senior Member |
|
|
There are many things that affect an execution plan, and some of those things are parameters that can be set at the session level. It is possible that your application has different parameter settings to the session where you are performing Explain Plan.
In v10 and later, Oracle can perform dynamic sampling of tables at run time - this can make the SQL choose a different plan on two separate executions.
There are lots of subtle things that can happen to make two executions of the same SQL have different plans. They happen infrequently, but you can never GUARANTEE that the plan you see from running Explain Plan is the one the application is using.
The only sure way to tell is to extract the actual plan used from the V$SQL_PLAN view or to use SQL Trace and TK*Prof.
Ross Leishman
|
|
|
|