Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Need to Improve Performance

by moritz (Cardinal)
on Jan 03, 2014 at 08:10 UTC ( #1069098=note: print w/ replies, xml ) Need Help??


in reply to Need to Improve Performance

$sql = "select seg_dtl_id from segmentation where seg_id = '1'"; $rs = $db->query($sql);

Since this doesn't depend on any data, there's no need to do it all over again in the loop. Do it once outside the loop. Also figure out a way to write a single SQL query that does everything you need (shouldn't be hard with a JOIN), so that you don't have to talk to the database so often.


Comment on Re: Need to Improve Performance
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2015-07-29 05:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls