in reply to Slow script: DBI, MySQL, or just too much data?

I had a similar problem and was able to solve it by disabling AutoCommit       my $dbh = DBI->connect("DBI:mysql:database=$database;host=localhost", ,$uname, $pswd,  {'RaiseError' => 1, AutoCommit => 0}); and then only committing changes after I had executed many-many execute statements...
my $max_rows_commit = 0; my $store = $dbh->prepare('INSERT ... '); foreach my $row (@rows){ $store->execute($row); $max_rows_commit++; if ($max_rows_commit >10000){ $dbh->commit; $max_rows_commit = 0; } } $dbh->commit;
A better reference for how to speed up DBI commands can be found here: http://www.perlmonks.org/bare/?node_id=273952 Good luck!