Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: DBI Performance help

by clueless newbie (Chaplain)
on Oct 09, 2010 at 15:32 UTC ( #864392=note: print w/replies, xml ) Need Help??


in reply to DBI Performance help

For timings set the "Profile" on each db handle:
$dbh->{Profile} = 6;
Change:
while ( @columns = $sth1->fetchrow_array ) { $inserted += $sth2->execute(@columns); ... } }
to:
while ($row=shift(@$cache) || shift@{$cache=$sth_o->fetchall_arrayref( +undef,$max_rows) || []}) { $inserted += $sth2->execute(@$row); ... };
NB: Bunce says that optimal value for $max_row depends on the number and size of columns returned.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://864392]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2017-05-25 02:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?