Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: why is a simple query parsed always?

Re: why is a simple query parsed always?

From: Howard J. Rogers <hjr_at_dizwell.com>
Date: Wed, 12 May 2004 07:41:22 +1000
Message-ID: <40a14876$0$442$afc38c87@news.optusnet.com.au>


utkanbir wrote:

> Hi ,
>
> I am monitoring the sql trace files (event 10046) , what i realized is
> it seems my sql statements are always parsed . At last i tried to run
> select * from dual in same session several times , and each time when
> i run the query it is parsed again. Why dont i reuse queries?
>
> This is the trace file output after rendering it by using tkprof:
>
> SELECT *
> FROM
> DUAL
>
>
> call count cpu elapsed disk query current
> rows
> ------- ------ -------- ---------- ---------- ---------- ----------
> ----------
> Parse 4 0.00 0.00 0 0 0
> 0
> Execute 4 0.00 0.00 0 0 0
> 0
> Fetch 4 0.00 0.00 0 12 0
> 4
> ------- ------ -------- ---------- ---------- ---------- ----------
> ----------
> total 12 0.00 0.00 0 12 0
> 4
>
> Misses in library cache during parse: 1
> Optimizer goal: CHOOSE
> Parsing user id: 46
>
>
> Kind Regards,
> hope

I don't know whether it's relevant or not to your specific case, but SQL statements are always re-parsed for the security/user bits and pieces. The fact that my library cache has an execution plan for 'select * from emp' doesn't mean to say that *you* have the rights to select from EMP. Oracle still has to check that, every time someone issues the command.

Dual is a bit of an odd one to test these things out on in any case. Try it with a different (real) table whilst you're in testing mode.

Regards
HJR Received on Tue May 11 2004 - 16:41:22 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US