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

Is there any way to speed this up? apart from indices of course?

Some queries can be optimized even without adding indices. Impossible to tell without seeing the query, though.

A very valuable tool is the explain command, maybe its output can inspire you.

Do you want your script to continue working on other things during the DB query? If yes, you could take a look at threads, or perhaps there's an option for non-blocking queries in DBI.

Replies are listed 'Best First'.
Re^2: DBI mysql insert into select speed :-/
by Cagao (Monk) on Jun 04, 2008 at 21:32 UTC
    I've fiddled with threads before and it all ended in tears.

    Not that I want my script to do anything during the query anyway. Just want it a bit faster, it's taking 10s to finish at the minute.

      You're basically telling us that you have slow SQL, that we shouldn't tell you to get the indexes right, and that it's too slow. And you don't show us any SQL that we could help you to improve. And the problem doesn't seem to have a connection to perl at all, because it's that database that's slow, not perl.

      So what do you expect us to do? Should we say "just add the --fast option to the mysql server"?

      Sorry, there is no silver bullet to speed things up (unless buying better hardware, of course).