Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: DBI mysql insert into select speed :-/

by bilfurd (Hermit)
on Jun 04, 2008 at 21:43 UTC ( [id://690256]=note: print w/replies, xml ) Need Help??


in reply to DBI mysql insert into select speed :-/

Four things come to mind:

First, depending on the MySQL host, you might be able to squeeze performance out of the machine by splitting the data sources. Let me explain:

If the data structure is complex, combine some of the complex SELECTs into temp tables. Add indices and try to run the process again.

Second, assuming the tables are indexed, etc., try changing your SQL statement. If your conditions are all located in the WHERE clause, try creating sub-queries to do the same thing. If you do have sub queries, reverse the process and try the conditions in the WHERE clause.

Third, make sure that you are not pulling from multiple views. Views are great for compartmentalizing code, but have to be completely processed before any actions are taken against the records.

The fourth thing is completely irrelevant, so forget I mentioned it.

Granted, these are not Perl fixes; however, my biggest successes came from hitting these three things first.

Good luck!

  • Comment on Re: DBI mysql insert into select speed :-/

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-20 01:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found