You need to enable JavaScript to run this app.
ByteHouse Cloud Data Warehouse Version

ByteHouse Cloud Data Warehouse Version

Copy page
Download PDF
DCL
Terminate statement (KILL)
Copy page
Download PDF
Terminate statement (KILL)

ByteHouse currently supports terminating queries (kill query).

KILL QUERY

The kill query statement forcibly terminates the currently running query.

Caution

If you only have read-only access (SELECT, SHOW, GET), you can only terminate queries that you have created. You can navigate through ByteHouse Console > access control > user > data privilege to view your data privileges. To obtain higher data management permissions, please contact the administrator for configuration. For details, see data privilege management.

Syntax

KILL QUERY 
  WHERE <where expression to SELECT FROM system.processes query> 
  [SYNC|ASYNC|TEST] 
  [FORMAT format]

The parameter descriptions are as follows:

| | | | \

ParameterRequiredDescription
\
WHERE <where expression to SELECT FROM system.processes query>YesUse the WHERE expression to define the conditions for the queries to be terminated. This example selects queries that satisfy the condition from the system.processes table and terminates them. You can replace system.processes with your table name.
\
[SYNCASYNCTEST]NoOptional values. Specify the type of query termination. Supported settings are SYNC, ASYNC, and TEST.\
\
* ASYNC: By default, asynchronous forced termination is used. Asynchronous termination will forcibly execute without confirming whether the current query has stopped.\
* SYNC: Synchronous termination waits for all queries to stop before terminating the query and displays process information. The information returned by SYNC is shown in the kill_status column and includes the following types:\
* finished – The query has been successfully terminated.\
* waiting – The termination signal has been sent; waiting for the query to end.\
* Other values explain the reason why the query cannot be terminated.\
* TEST: TEST only checks the user's privileges and lists the operations to be terminated.
\
[FORMAT format]NoOptional values. Defines the output format of the command execution result. The default output format is TabSeparated. Common supported formats include TabSeparated, CSV, Pretty, JSON, JSONEachRow, XML, and more.

Examples

Example 1: Forcibly terminate a specific query
  1. Obtain the list of queries that have not yet completed.

    SHOW PROCESSLIST WHERE query like 'SELECT%'
    
  2. Terminate the query.

    KILL QUERY WHERE initial_query_id='2-857d-4xxx-9xxx-327xxxxx0a90'
    

Example 2: Synchronously terminate all queries run by a user
  1. Obtain the list of queries that have not yet completed.

    SHOW PROCESSLIST
    
  2. Terminate the queries.

    KILL QUERY WHERE user='username' SYNC
    

Last updated: 2026.03.31 16:13:53