Execution plan in SQL

Question posted in Computer Software on 08 2010
Rate question difficulty level 0 Votes
How does the excution plan works ?
Please specify it's life cycle and expain it's plus and minus points .
 
 
3 Answers
 
Every SQL statement is examined by the Cost Based Optimizer when it submitted to run. Part of this "parsing" of a new statement involves the optimizer deciding on the best way to retrieve the desired data. All subsequent executions of that exact statement will use the execution plan derived at the first parse of the statement, until something causes the statement to be reparsed.

These include gathering fresh statistics; adding or dropping an index; the statement being aged out of the SQL area; and the instance restarting.

John Goodhue

08/05/2010
 
 
As John says, wehen the SQL parsed for the first time, the execution is dervied based on statistics information for the objects, plus bind values as part of the SQL. It will choose the the optimal method based on cost for those bind values, if the SQL gets executed with different set of values, then it may not the optimal way for those bind values, this is what is called as "bind peaking", in such case you need to manually remove the SQL from the cache either by using a DBMS package or by altering th table.

08/06/2010
 
 
Execution plan of a repeat SQL is also affected by Cursor_Sharing parameter setting (Force|Exact|Similar)

08/08/2010
 
 
Add an answer*
 
Your name
Email
 
Company: Binat
Location: Israel
DB data base sql

add a question

arrow_blue


Now hiring!
---------------------------
---------------------------
---------------------------
---------------------------
---------------------------
---------------------------
---------------------------