Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2016-10-20 19:42 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (280 votes). Check out past polls.