in reply to VVP:Faster DBI'ing?

You're getting a cartesian product in the second sth definition. You need to have something in your where clause that relates podetail and poheader (like in the first sth definition).

rdfield

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

    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.


      Kanji,

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

      rdfield