JAEN

SQL

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
Kill the long-running lock holderConfirm business impact before killing.
See the whole flow →

Related commands

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