Optimization scaling importer performance
We can merge and batch execute the rows change to optimization performance.
Merge
insert + insert -> insert(dumper back off) insert + update -> insert insert + delete -> delete update + insert -> insert(dumper back off) update + update -> update update + delete -> delete delete + insert -> insert delete + update -> update(dumper back off) delete + delete -> delete
Batch Execute
- delete
- insert
- update
Good job.
Case 2: insert + update -> insert
If the program occur exception after a data inserted, and then this data updated.
By resume from break-point dumper back off, program received insert + update, which will merge to insert.
This data will ignored by INSERT IGNORE sql .
So maybe you should use REPLACE INTO sql or other plans.