The first parse is a 'hard' parse.  This is the parse that 
checks for existance of tables, privileges, and a bunch of
other stuff I probably don't know about.

The second parse is a 'soft' parse.  It checks for existence
of the SQL in the Oracle library cache.

Oracle-Tools may not differentiate, or you may be on an
older version of Oracle that reported them as equivalent.

Jared



On Thursday 28 November 2002 04:13, Tim Bunce wrote:
> Try $dbh->prepare($call, { ora_check_sql => 0 });
>
> (The underlying issue is either an Oracle bug or that one of the
> two parse steps counted isn't a real parse. DBD::Oracle does a
> 'describe only' execute at prepare() time and then a normal execute
> when execute() is called. The execute() should not count as a parse
> as it has already been parsed, but oracle seems to do, or at least
> count, another parse.)
>
> Tim.
>
> p.s. This is not about the development of drivers so belongs on
> dbi-users and not on dbi-dev.
>
> On Thu, Nov 28, 2002 at 11:37:59AM +0100, Henning Meyer wrote:
> > Hello,
> >
> > I use Perl 5.6.0, DBI 1.30 and DBD-Oracle 1.12.
> > While checking the performance, my Oracle-Tools discovered, that the
> > Database does two prepares for every
> > execute.
> >
> > My Perl-Code looks like this:
> >
> > my $cur=$dbh->prepare($call);
> > die "Prepare-Error: $DBI::err\n$call\n$DBI::errstr\n" if
> > ($DBI::err);
> > $cur->execute(@$vars);
> > die "Execute-Error:
> > $DBI::err\n$call\n$DBI::errstr\n" if
> > ($DBI::err);
> > my @res=();
> > while (my $href=$cur->fetchrow_hashref) {
> >         die "Fetch-Error: $DBI::err\n$call\n$DBI::errstr\n" if
> > ($DBI::err);
> >         for(keys %$href) {
> >                 $href->{$_}=~s/[\s]*$//;
> >                 $href->{$_}=~s/^[\s]//;
> >         }
> >         push(@res,$href);
> > }
> > $cur->finish;
> > return(\@res);
> >
> > How could it be, that there is an prepare/execute ratio of 2?  I have
> > execute much equal +statements with bind-Values, and its very annoying
> > that there are 400 prepares for 200 +executes instead of one prepare.
> >
> > Any hints?
> >
> > Henning
> >
> > --
> >                       '''
> >                      (0 0)
> >        +-------oOO----(_)-------------+
> >
> >        |Henning Meyer                 |
> >        |SIEMENS AG  ICM N PG ES PD D 2|
> >
> >        +--------------------oOO-------+
> >
> >                     |__|__|
> >
> >                     ooO Ooo

Reply via email to