KILL QUERY can terminate the query being executed, and is often used to terminate slow queries.
Users with the God role can kill any query. Other roles can only kill their own queries.
KILL QUERY (session=<session_id>, plan=<plan_id>);
session_id: The ID of the session.
plan_id: The ID of the execution plan.
The ID of the session and the ID of the execution plan can uniquely determine a query. Both can be obtained through the SHOW QUERIES statement.
This example executes
KILL QUERY in one session to terminate the query in another session.
nebula> KILL QUERY(SESSION=1625553545984255,PLAN=163);
The query will be terminated and the following information will be returned.
[ERROR (-1005)]: ExecutionPlanId does not exist in current Session.
Last update: March 22, 2023