KILL QUERY
WHERE clause of the KILL query.
Examples:
First, you’ll need to get the list of incomplete queries. This SQL query provides them according to those running the longest:
List from a single ClickHouse node:
ASYNC), which does not wait for confirmation that queries have stopped.
The synchronous version (SYNC) waits for all queries to stop and displays information about each process as it stops.
The response contains the kill_status column, which can take the following values:
finished– The query was terminated successfully.waiting– Waiting for the query to end after sending it a signal to terminate.- The other values explain why the query can’t be stopped.
TEST) only checks the user’s rights and displays a list of queries to stop.
KILL MUTATION
The presence of long-running or incomplete mutations often indicates that a ClickHouse service is running poorly. The asynchronous nature of mutations can cause them to consume all available resources on a system. You may need to either:- Pause all new mutations,
INSERTs , andSELECTs and allow the queue of mutations to complete. - Or manually kill some of these mutations by sending a
KILLcommand.
system.mutations table using the filter specified by the WHERE clause of the KILL query.
A test query (TEST) only checks the user’s rights and displays a list of mutations to stop.
Examples:
Get a count() of the number of incomplete mutations:
Count of mutations from a single ClickHouse node:
is_killed=1 column (ClickHouse Cloud only) in the system.mutations table does not necessarily mean the mutation is completely finalized. It is possible for a mutation to remain in a state where is_killed=1 and is_done=0 for an extended period. This can happen if another long-running mutation is blocking the killed mutation. This is a normal situation.