Today a colleague ran an update on a large table:
The update was a simple one:
He asked me to kill his thread after about ~30 minutes. So I did. The query state then changed to Freeing Items. He ran the query without a where clause accidentally.
I tried desperately to clear the state so that other transactions could process more efficiently.
However, nothing I did brought the server back any more quickly. It took ~30 minutes more to complete whatever steps it was performing and return to normal operations.
The things I tried were;
* Disable the Query Cache and set the cache size to 0
* Flush Logs
* Reset Query Cache
* Flush Tables parts
I am wondering if folks have any insight as to a> what the server does when it is 'freeing up items' and b> how to achieve that more quickly?
As an aside, the flush tables was something I found online. That actually caused all of the queries to queue up until I killed my thread. I have now noticed that a single table should be 'flush table table_name' and not 'flush table'S' table_name' I am not sure if that would still try to flush all of the tables!
Thanks for any insight!!!
Shawn
mysql> show table status from auto like 'parts'\G *************************** 1. row *************************** Name: parts Engine: InnoDB Version: 10 Row_format: Compact Rows: 16209517 Avg_row_length: 1374 Data_length: 22272802816 Max_data_length: 0 Index_length: 16715235328 Data_free: 754974720 Auto_increment: NULL Create_time: 2008-04-27 12:57:08 Update_time: NULL Check_time: NULL Collation: latin1_swedish_ci Checksum: NULL Create_options: Comment: Parts Table 1 row in set (0.76 sec) Server> ls -lh | grep parts.ibd -rw-rw---- 1 mysql mysql 38G Oct 26 14:07 parts.ibd
The update was a simple one:
UPDATE parts set column = 'Y'
He asked me to kill his thread after about ~30 minutes. So I did. The query state then changed to Freeing Items. He ran the query without a where clause accidentally.
I tried desperately to clear the state so that other transactions could process more efficiently.
However, nothing I did brought the server back any more quickly. It took ~30 minutes more to complete whatever steps it was performing and return to normal operations.
The things I tried were;
* Disable the Query Cache and set the cache size to 0
* Flush Logs
* Reset Query Cache
* Flush Tables parts
I am wondering if folks have any insight as to a> what the server does when it is 'freeing up items' and b> how to achieve that more quickly?
As an aside, the flush tables was something I found online. That actually caused all of the queries to queue up until I killed my thread. I have now noticed that a single table should be 'flush table table_name' and not 'flush table'S' table_name' I am not sure if that would still try to flush all of the tables!
Thanks for any insight!!!
Shawn