Thursday 9 August 2012

Different Stages of an SQL statement - Optimizer


An SQL statement passes through 4 stages.  They are, Parse, bind, execute and fetch.
  •          Parse:
o   Searches for identical statement in the MEMORY,
o   Checks for the syntax, object name and privileges,
o   Locks objects used during parse and
o   Create and store the execution plan.
  •          Bind:
o   Obtains the values for the any host variables [& or &&],
  •          Execute:
o   Process the statement, and
  •          Fetch:
   o   Return rows to the user process.
The optimizer of the server determines the most efficient way to run a SQL statement. This is an important step in the processing of any data manipulation language (DM(Q)L) statement: SELECT, INSERT, UPDATE, MERGE, or DELETE.



No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...

ShareThis