Remove duplicates in large MySql table

前端 未结 6 2053
自闭症患者
自闭症患者 2021-01-06 14:44

I have a question about MySql. I have a table with 7.479.194 records. Some records are duplicated. I would like to do this:

insert into new_table 
  select *         


        
6条回答
  •  Happy的楠姐
    2021-01-06 15:24

    From my experience when your table grows to number of millions records and more the most effective way to handle duplicates will: 1) export data to text files 2) sort in file 3) remove duplicates in file 4) load back to database

    With increasing size of the data this approach works eventually faster than any SQL query you may invent

提交回复
热议问题