How to improve INSERT performance on a very large MySQL table

后端 未结 4 630
刺人心
刺人心 2020-12-17 21:14

I am working on a large MySQL database and I need to improve INSERT performance on a specific table. This one contains about 200 Millions rows and its structure is as follow

4条回答
  •  失恋的感觉
    2020-12-17 21:59

    You could use

    load data local infile ''
    REPLACE
    into table 
    

    etc...

    The REPLACE ensure that any duplicate value is overwritten with the new values. Add a SET updated_at=now() at the end and you're done.

    There is no need for the temporary table.

提交回复
热议问题