I have got quite slow query (actually this is data loading from mysql.dump). Now I want to check how many rows are already loaded.
select count(*) from my_table;
As far as data is loading, my_table
is locked, so I can't execute this sql before dump is loaded.
Cmd ID State User Host DB Time Query
Query 191 update root localhost rehub 00:09 INSERT INTO `my_table` VALUES ...
Query 189 Waiting for table root localhost rehub 06:25 select count(*) from my_table
So is there a way to pause query 191, execute query 189 and then resume query 191?
Now pause SQL Server by right clicking on the server instance and selecting Pause. It opens up a pop-up window to confirm or cancel the pause operation. Click Yes to go ahead with the pause operation.
Run the following command: mysql> SELECT GROUP_CONCAT(CONCAT('KILL ',id,';') SEPARATOR ' ') FROM information_schema. processlist WHERE user <> 'system user'; This will kill all your MySQL queries.
No there is not a way to suspend a query.
If you're doing bulk load work you might want to use a bulk loader that commits every few thousand rows.
Also, using MyISAM instead of InnoDB will alleviate this problem. MyISAM is a good choice for bulk processing where you're not primarily concerned with transactional integrity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With