Perl Monk, Perl Meditation | |
PerlMonks |
Re: An Array Without and Indexby CountZero (Bishop) |
on Aug 13, 2012 at 13:50 UTC ( [id://987124]=note: print w/replies, xml ) | Need Help?? |
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
In Section
Seekers of Perl Wisdom
|
|