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?? |
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!
In Section
Seekers of Perl Wisdom
|
|