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 -> cursors question

cursors question

From: murthy <muthy69_at_yahoo.com>
Date: 1 Jul 2002 06:31:02 -0700
Message-ID: <300217f3.0207010531.7b58e834@posting.google.com>


I was testing this while reading Tom Kyte's book Can anyone help clarify my doubt

select name,value
from v$sysstat
where name like '%parse count%'

NAME                                                    VALUE

------------------------------------------- -------
Parse count(total) 5049 Parse count(hard) 1214

declare
type rc is ref cursor;
l_rc rc;
l_dummy all_objects.object_name%type;
begin
for i in 1..1000 loop
open l_rc for 'select object_name from all_objects where object_id= '||i;
fetch l_rc into l_dummy;
close l_rc;
end loop;
end;

After the

NAME                                                    VALUE

------------------------------------------- -------
Parse count(total) 7117 Parse count(hard) 2222

My doubt is why did the anonymous PL/SQL block cause more than 2000 soft parses
 and about 100 hard parses.
I turned on tracing and saw that
select text from view$ where rowid=:1 is taking 1000 parses, executes and fetches each.
Why is this statement taking 1000 parses ?

thanks in advance for any reply. Received on Mon Jul 01 2002 - 08:31:02 CDT

Original text of this message

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