Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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 - || "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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2018-04-26 19:50 GMT
Find Nodes?
    Voting Booth?