Clean up MySql database
There are things you can think about when deleting data from a large table. In my case the table contains 40 million records.
Symptoms 1: it took long time to execute a delete statement.
Solution: delete smaller chunks of data
Use the following command to find out what are being executed in database
mysql> show processlist;
To see which tables are locked (in used)
mysql> show open tables where in_use > 0;
To kill a process ex. a query that takes long time to execute
mysql> show processlist; mysql> kill <pid>;