Kill query / session
DestructiveKill a query/session
KILL <id>;
Terminates a runaway query or a deadlock-causing session.
Examples
SELECT pg_terminate_backend(12345);Terminate a PG backend
Syntax
(MySQL) KILL <id>; (PG) SELECT pg_terminate_backend(<pid>);
Before you run it
Aborts the target transaction; verify the id.
Used when you see
Deadlocks and lock waits
2
See the whole flow →Kill the long-running lock holderConfirm business impact before killing.
Related commands
- Show running queriesShow running queries
Check it once more before you run it
Some commands cannot be undone if one flag is wrong. An on-device reference works with no connection. Free to install, no ads.
Get it free on the App Store