Warning
SingleStore 9.0 gives you the opportunity to preview, evaluate, and provide feedback on new and upcoming features prior to their general availability. In the interim, SingleStore 8.9 is recommended for production workloads, which can later be upgraded to SingleStore 9.0.
KILL CONNECTION and KILL QUERY
On this page
Kill the connection on the specified thread.
Syntax
KILL CONNECTION <internal_process_id> [<node_id>]
KILL QUERY <internal_process_id> [<node_id>]
KILL QUERY COMPILE <query_id> [<node_id>]
Arguments
-
query_
- see note below.id -
internal_
- ID of the thread to kill.process_ id -
node_
- ID of the node (aggregator) on which the query/thread is running.id If the node_
is not specified, the query/thread running on the current node is killed.id Important
You can query the
information_
table for the required parameter values, where theschema. MV_ PROCESSLIST ID
field in the table contains the thread/internal process ID and theNODE_
field contains the ID of the node.ID For
KILL QUERY COMPILE
, get the ID for the query from the LMV_ASYNC_ table,COMPILES ID
column.
Remarks
-
internal_
- ID of the thread to kill, which can be found by running SHOW_process_ id PROCESSLIST . -
KILL CONNECTION
will disconnect the client associated withinternal_
.process_ id This is the default, meaning that running KILL <>
will have the same result. -
KILL QUERY
allows you to kill a query running on any aggregator in the cluster. -
KILL QUERY
will not disconnect the client associated withinternal_
.process_ id Instead, the client will receive an error. -
Any query running on the connection will be rolled back.
-
SingleStore 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 should be run on the master aggregator or a child aggregator node (see Node Requirements for SingleStore Commands).
Note
When killing queries on remote nodes (if a user specifies a
node_
), the query will only be killed if the user has theid PROCESS
privilege or ifsync_
is enabled.permissions -
Refer to the Permission Matrix for the required permission.
Example
KILL CONNECTION 3123;Query OK, 0 rows affected (0.00 sec)
Stopping a query compile:
SELECT * FROM information_schema.lmv_async_compiles;
+--------+--------+--------------------------------------------------------+-------------------+---------+
| ID | PID | QUERY_TEXT | TIME_SINCE_SUBMIT | STATUS |
+--------+--------+--------------------------------------------------------+-------------------+---------+
| 210812 | 899514 | Query (null).'SELECT * FROM accounts WHERE < ... >. ' | 0.000 | running |
+--------+--------+--------------------------------------------------------+-------------------+---------+
KILL QUERY COMPILE 210812;
Related Topics
Last modified: August 1, 2024