I delete about 1/3 of the entries in the table using the query:
DELETE FROM `abc` LIMIT 10680000;
The request appears in the list of processes with a status update. A total of 30 million records. The table has 5 columns and two indexes, and when flushing to SQL, the file is about 9 GB.
This is the only database and table in MySQL.
It runs on a machine with 2 GB of memory, a quad-core 3 GHz processor and a fast SAS drive. MySQL does not perform any read or write operations except this DELETE operation. Other โheavyโ processes do not work on the machine.
This query has been running for more than two hours - how much time can I expect from it?
Thanks for the help! I am new to MySQL, so any tidbits about what happens โunder the hoodโ during the execution of this query are certainly appreciated.
Let me know if I can provide any other information that would be relevant.
Update: I just ran COUNT(*) , and after 2 hours, it deleted only 200 thousand records. I think I'm going to take the advice of Joe Enos and see how good it is to insert data into a new table and discard the previous table.
Update 2: Sorry, I'm actually reading the number incorrectly. After 2 hours, he did not delete anything . I'm confused. Any suggestions?
Update 3: I ended up using mysqldump with --where "true LIMIT 10680000,31622302" and then imported the data into a new table. Then I deleted the old table and renamed the new one. It took a little more than half an hour.
source share