http://www.perlmonks.org?node_id=1004045


in reply to LOAD DATA LOCAL INFILE not working

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.

Replies are listed 'Best First'.
Re^2: LOAD DATA LOCAL INFILE not working
by Anonymous Monk on Nov 15, 2012 at 18:09 UTC

    Around 2 million rows of data. Thanks for your suggestion, will try it!