How much data are you talking about? The database has to sync after each transaction, and most hard drive setups can only do that about a hundred times a second. Note that every insert/update/other statement counts as a transaction unless otherwise specified. You should instead wrap the inserts in an explicit transaction, like this:
# assumes RaiseError = 1
eval {
$dbh->begin_work;
# insert 10k records
# ...
$dbh->commit;
} or do {
print "failed to insert records!\n";
$dbh->rollback;
};
See also DBI's section titled Transactions.