Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Module Pondering

by Masem (Monsignor)
on Jan 18, 2002 at 21:23 UTC ( #139873=note: print w/ replies, xml ) Need Help??


in reply to Module Pondering

While using fetchrow_hashref is the counterbalance to using "select * ...", the problem is that _hashref is *slow* compared to fetchrow_array or the likes, and if this is a highly-accessed script, that might cost significant CPU time. It's typically better to specify what columns you want in the select, and then, if you really need that hash, use a hash slice to merge the column names and data (eg @row{ @columns } = fetchrow_array). If you don't necessarily know column names to start, it's easy to get them via the DBI interface, and this only has to be done once at the start of the program.

-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important


Comment on Re: Module Pondering
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2014-04-21 13:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (495 votes), past polls