Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

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

Comment on Re: Module Pondering
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2015-11-30 07:49 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (765 votes), past polls