v.18.4Improvement

Support for KILL and OPTIMIZE Queries with ON CLUSTER

Support for running KILL and OPTIMIZE queries that specify ON CLUSTER Winter Zhang.
Support for running KILL and OPTIMIZE queries with the ON CLUSTER clause in ClickHouse.

Why it matters

This feature allows users to execute KILL and OPTIMIZE queries across all nodes of a specified cluster, simplifying cluster-wide management tasks. It enables efficient termination of queries and optimization of tables on distributed setups, improving operational control and resource management.

How to use it

Use the KILL or OPTIMIZE statement followed by the ON CLUSTER <cluster_name> clause to run the command across all nodes in the cluster. For example:

KILL QUERY WHERE query_id = 'some_id' ON CLUSTER my_cluster;
OPTIMIZE TABLE my_table ON CLUSTER my_cluster;