Re: Precompiled statement?



On Apr 22, 11:46 pm, Taras_96 <taras...@xxxxxxxxx> 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
.



Relevant Pages

  • Re: newbie, getting cost plan
    ... I want to get the -real- cost and plan of an sql statement, ... assume that you can execute the SQL statement in question in SQL*Plus, ... However, be aware that this dilutes the information in the trace file, ...
    (comp.databases.oracle.server)
  • Re: Precompiled statement?
    ... The driver sends the SQL string to the DBMS. ... compiles/creates a plan for executing what the SQL wants. ...
    (comp.lang.java.databases)
  • Re: Slow SQL, too many logical reads ?
    ... I would be tempted to try reformating the SQL statement like this to ... Oracle is performing a nested loop join between the subquery and the ... The explain plan for... ... (Run your query) ...
    (comp.databases.oracle.server)
  • Re: EXISTS and OR statement
    ... i posted the explain plan above. ... i wrote the sql statement with the EXISTS and OR statement but it's ... Daniel Morgan ... Puget Sound Oracle Users Group ...
    (comp.databases.oracle.misc)
  • Re: perl- dbi
    ... And the driver for the DBMS you plan to use. ... "I don't suffer from insanity - I enjoy every minute of it." ...
    (perl.dbi.users)