Skip to content

Kill queries

KILL QUERY can terminate the query being executed, and is often used to terminate slow queries.

Note

Users with the God role can kill any query. Other roles can only kill their own queries.

Syntax

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.

Examples

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[1001] does not exist in current Session.

Last update: February 1, 2023