诶 今天一早就办了个蠢事. 写了个行情收集的脚本.存到mysql中计划是保存3天的数据, 结果没有启动删除脚本....
数据量 9kw 找到脚本后执行了一下....也是醉了 10分钟啥动静都没有. 我就关掉脚本了.
通过下面方法查看 delete
mysql> select * from information_schema.`PROCESSLIST` where info is not null;|ID| USER| HOST| DB| COMMAND| TIME| STATE| INFO|
|-|-|-|-|-|-|-|-|
|10845565| xx| xxx:xxx| xx-data |Query| 0| executing| select * from information_schema.PROCESSLIST where info is not null|
|10844901| xx| xxx:xxx| xx-data| Execute| 375| updating| DELETE FROM market_collection_history WHERE created < 1577068173|
观察到进程 kill ID 关掉进程
mysql> kill 10844901|ID| USER| HOST| DB| COMMAND| TIME| STATE| INFO|
|-|-|-|-|-|-|-|-|
|10845565| xx| xxx:xxx| xx-data| Query| 0| executing| select * from information_schema.PROCESSLIST where info is not null|
|10844901| xx| xxx:xxx| xx-data| Killed| 642| query end|DELETE FROM collection_history WHERE created < 1577068173|
执行完 `Killed` 好久都不结束, 百度了一下 当执行大数据量 `update delete` 写操作了, kill 后回 回滚...... 时间长是应该的 不长是不应该的........