io - Does it make any sense that I use multi processes to insert data to MySQL? -


i need insert 300 millions data records mysql, wonder make sense use multi-processes make ?

situation 1 : 300 millions records insert 1 table.

situation 2 : 300 millions records insert multi tables.

what bottlenecks on these 2 situations ?

the data source 800+ txt files.


i know there's command load data infile, want understand question. :d

since have lots of data consider using load data. it's the fastest method of importing data files according mysql docs.

load data infile
load data infile statement reads rows text file table at high speed.

speed of insert statements
when loading table text file, use load data infile. this 20 times faster using insert statements. see section 13.2.6, “load data infile syntax”.
...
insert still slower loading data load data infile, when using strategies outlined.

load data infile '/path/to/your/file.csv'  table table_name  fields terminated ',' lines terminated '\n' -- or '\r\n' ignore 1 lines; -- use ignore if have header line in file 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -