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

The problem you're having here is that you don't really know what "sending data" means in the MySQL status field. You probably should just ignore that and look at the results of EXPLAIN instead.

Caching the query results can be useful if you're doing paging of a very slow query, but it should be your last resort. It complicates things.

Since this is not really Perl-related, my suggestion would be to take your query and any questions about the EXPLAIN to the MySQL users lists, which is very helpful.

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

Replies are listed 'Best First'.
Re^2: DBI mysql insert into select speed :-/
by Cagao (Monk) on Jun 04, 2008 at 22:20 UTC
    Thanks for that,

    My concern was about seeing 'sending data', which to me implies that the query has finished and mysql is now sending the results back to Perl space.

    Doing an INSERT INTO ... SELECT with a do() shouldn't send anything back, or should it?
      No, that won't send data to Perl other than whether or not the query succeeded. It's doing something else during that time, possibly copying the results into your new table.