I am trying to delete duplicate records from a mysql database. With the below command, it will delete all duplicates and will keep one row. In my database there are 300,000 records and I expect some 100,000 rows are duplicates.
The duplicates need to be deleted by the below command but the problem is, I had given the command in the evening after 9 hours it is still running.
DELETE n1 FROM tableA n1,tableA n2 WHERE n1.title= n2.title AND n1.id > n2.id
What is happening? Can anyone explain?
Trying:
And to explain it:
n1.title = n2.titledoes not use an index.This query will be better: