I want to upload a large csv file approx 10,000,000 records in mysql table which also contain same or more no. of records and also some duplicate records. I tried Local data infile but it is also taking more time. How can I resolve this without waiting for a long time. If it can't be resolved then how can I do it with AJAX to send some records and process it at a time and will do it till the whole csv get uploaded/proccessed.
LOAD DATA INFILE
isn't going to be beat speed-wise. There are a few things you can do to speed it up:
ALTER TABLE *foo* DISABLE KEYS
, but InnoDB doesn't support that, unfortunately. You'll have to drop them instead.If the problem is that its killing a database performance, you can split your CSV file into multiple CSV files, and load them in chunks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With