in reply to Re: VVP:Faster DBI'ing?
in thread VVP:Faster DBI'ing?

Aside from the cartesian issue that rdfield and derby note, you might also get a speed increase by using prepare_cached or moving the second prepare outside the foreach loop so that you're not (re)prepareing the same statement over and over (especially silly when you go to the trouble of using placeholders!).

$sth = $dbh->prepare(...); foreach $po (@po) { for ($count=0; $count<=$i;$count++) { $sth->execute($old[$count],$po); # ... } }

    --k.


Replies are listed 'Best First'.
Re: Re: Re: VVP:Faster DBI'ing?
by rdfield (Priest) on Mar 12, 2002 at 16:34 UTC
    Kanji,

    Not true in Oracle - the compiled statement would be cached and re-used. I would use your suggestion though - better style.

    rdfield