Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: LOAD DATA LOCAL INFILE not working

by Anonymous Monk
on Nov 15, 2012 at 17:31 UTC ( #1004045=note: print w/ replies, xml ) Need Help??


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.


Comment on Re: LOAD DATA LOCAL INFILE not working
Download Code
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!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1004045]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (13)
As of 2014-10-01 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (19 votes), past polls