Skip to content

Query _best_ - Mysql Kill A

Query OK, 0 rows affected (0.00 sec) She ran SHOW PROCESSLIST again. The row with Id 19283 was gone — replaced by a single line: KILLED (for a brief moment, then disappeared).

The next morning, Maya added a monitoring alert for queries running longer than 60 seconds. She also taught the dev team how to catch themselves: mysql kill a query

-- Find long-running queries SELECT id, user, time, state, info FROM information_schema.PROCESSLIST WHERE command != 'Sleep' AND time > 60; -- Kill one KILL QUERY <id>; Query OK, 0 rows affected (0

KILL <connection_id>; -- kills the entire connection, not just the query She never forgot that 2 AM wakeup. And from then on, every SELECT on large tables had to justify its indexes in the design review. “With great SELECT comes great responsibility — and the ability to KILL QUERY when responsibility fails.” She also taught the dev team how to