Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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.

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 wandering the Monastery: (7)
As of 2016-06-25 04:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (323 votes). Check out past polls.