Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: How to increase the efficiency of the code wen working with DB?

by SimonClinch (Chaplain)
on May 26, 2011 at 13:07 UTC ( #906828=note: print w/ replies, xml ) Need Help??


in reply to How to increase the efficiency of the code wen working with DB?

My first reaction is try with GROUP BY instead of DISTINCT - it gives many RDBMSs the chance to use a faster internal algorithm. Also it doesn't look so much like you're doing it on the face of it, but just in case: avoid reconnecting to the database between queries - maintain a single DBI database handle unless you are doing parallel processing. Consider using multiple database handles and forks (updated and see also Parallel::ForkManager) if the opportunity for parallel processing exists to save elapsed time, especially if there are many such iterations to parallelise.

One world, one people


Comment on Re: How to increase the efficiency of the code wen working with DB?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2015-07-03 12:57 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 (53 votes), past polls