On Apr 22, 11:46 pm, Taras_96 <taras...@[EMAIL PROTECTED]
> wrote:
> I think my original question may have been unclear.
>
> What is actually being done when a SQL statement is being 'compiled'?
> Query plan? Parsing of SQL statement? Something else?
>
> Thanks
>
> Taras
The driver sends the SQL string to the DBMS. The DBMS parses it, and
compiles/creates a plan for executing what the SQL wants. This
includes
verifying the names of tables and columns etc, choosing what index to
use etc. This plan may include place-holders for data values passed in
as parameters. This is very similar to a session-scoped stored
procedure.
Then, when the driver sends the needed parameter values, and says
'go',
the DBMS executes the plan. A plain statement does the same, all in
one call,
except the DBMS doesn't retain the plan, so even an immediate repeat
of
the exact same query requires the DBMS to re-parse, re-check, and re-
plan,
and re-execute.
Joe Weinstein at BEA Systems


|