Join the MemSQL Community Today
Get expert advice, develop skills, and connect with others.

KILL CONNECTION

Kill the connection on the specified thread. Rolls back any query running on the thread.

Syntax

KILL CONNECTION thread_id [node_id]
KILL QUERY query_id [node_id]

Arguments

  • thread_id - ID of the thread to kill.
  • query_id - ID of the query to kill.
  • node_id - ID of the node (aggregator) on which the query/thread is running. If the node_id is not specified, the query/thread running on the current node is killed.
    Info

    You can query the information_schema.MV_PROCESSLIST table for the required parameter values, where the ID field in the table contains the thread/query ID and the NODE_ID field contains the ID of the node.

Remarks

  • thread_id - ID of the thread to kill. Find by running SHOW_PROCESSLIST.
  • KILL CONNECTION will disconnect the client associated with thread_id. This is the default.
  • KILL QUERY allows you to kill a query running on any aggregator in the cluster.
  • KILL QUERY will not disconnect the client associated with thread_id. Instead, the client will receive an error.
  • Any query running on the connection will be rolled back.
  • MemSQL checks for the kill bit during any potentially long running loop during query execution and rolls back the query’s transaction if the kill bit is set.
  • This command must be run on the master aggregator or a child aggregator node (see Node Requirements for MemSQL Commands).

Example

memsql> KILL CONNECTION 3123;
Query OK, 0 rows affected (0.00 sec)

Related Topics