mysql multi-table merge into one table

Someone proposed to combine 4 tables into one. The amount of data is relatively large, with 40 million pieces of data. There is a lot of duplicate data, and a column needs to be deduplicated.

Ideas:

1. Export data. select into outfile.

2. Transfer to the server where the data is to be imported.

3. Create a new table with the same primary key and constraints as those three tables.

4, LOAD DATA INFILE import. Use the replace parameter to cover to achieve the purpose of deduplication.

LOAD DATA INFILE '/backup/tbl_get.csv' replace INTO TABLE emob.tbl_new;

LOAD DATA INFILE '/backup/tbl_jue.csv' replace INTO TABLE emob.tbl_new;

LOAD DATA INFILE '/backup/tbl_ors.csv' replace INTO TABLE emob.tbl_new;

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324478955&siteId=291194637