While fixing an existing script and rerunning it, I noticed that at a particular “DROP TABLE IF EXISTS..” , the command just gets struck. It never comes out. After worrying for a while, I finally figured the problem – the tables were locked from previous session.
Do these steps to make sure all the tables are unlocked –
a) show open tables;
If in_use > 1, it means that the table is locked and hence any operation on the table will go to a wait mode.
b) show processlist;
Get all the process_id’s from here. And then use the below command –
Once all the processes are killed, run a) again to check all the in_use are 0.
Run your query again, it would sure be quick!!