Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: An Array Without and Index

by CountZero (Bishop)
on Aug 13, 2012 at 13:50 UTC ( [id://987124]=note: print w/replies, xml ) Need Help??


in reply to An Array Without and Index

I will not repeat the comments already made by the other Monks. I just wondered why you first select a list of addresses from the database and then plug in each address one by one in a new select statement to fetch the related IDs.

Unless you made some changes to the array of addresses, it should be possible to fetch the adresses and their IDs in one select statement. That will really speed-up your program.

When using databases, it is my experience that it is almost always "best" (= faster or less memory use or easier) to let the database do all the heavy lifting and only reserve the really difficult parts (like formatting or calculating or transforming the data) for your program.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-23 07:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found