Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Speeding up the DBI

by jbrugger (Parson)
on Jun 09, 2005 at 10:06 UTC ( #465041=note: print w/ replies, xml ) Need Help??


in reply to Speeding up the DBI

I found a nice article here.
Basically, you want large sets not in an arrayref, but as a hash, since it's more clear what column holds the data.
e.g.

# tested this on live data, this is twice as fast as fetchrow_hashref, + and has the same advantage.. # example taken from the link above. my @fields = (qw(emp_id first_name monthly_payment)); $sth->execute; my %rec =(); $sth->bind_columns(map {\$rec{$_}} @fields); print "$rec{emp_id}\t", "$rec{first_name}\t", "$rec{monthly_payment}\n" while $sth->fetchrow_arrayref;
*Update*
Hmm, Funny indeed, anyway, i still consider this as a valuable way to speed up the DBI. :-)

"We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.


Comment on Re: Speeding up the DBI
Download Code
Re^2: Speeding up the DBI
by cchampion (Curate) on Jun 09, 2005 at 10:22 UTC

    Now that was quite funny. :-)

    You are quoting to gmax from an article that he has written (in case you didn't realize it, the article says that it was originally published as DBI recipes.)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://465041]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2014-07-30 22:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (241 votes), past polls