diff --git a/docs/sql_reference/commands/queries/cancel.md b/docs/sql_reference/commands/queries/cancel.md index 0d999092..37506cb3 100644 --- a/docs/sql_reference/commands/queries/cancel.md +++ b/docs/sql_reference/commands/queries/cancel.md @@ -37,7 +37,7 @@ CANCEL QUERY WHERE query_id = '12345'; Consider a scenario where there is a long-running query that needs to be canceled to free up system resources. The following statement can be used to obtain the query_id: ```sql -select status, duration_usec, query_text, query_id from information_schema.running_queries; +SELECT status, duration_usec, query_text, query_id FROM information_schema.running_queries; ``` Suppose the long-running query is identified with query_id '12345': @@ -47,9 +47,5 @@ CANCEL QUERY WHERE query_id = '12345'; This will initiate the cancellation process for the specified query_id. While the query is not immediately removed from running_queries, its status will be observed as `CANCELING` there. After the cancellation process is completed, the query will have the `CANCELED` status in the `information_schema.query_history` view: ```sql -select query_id, status from information_schema.query_history; +SELECT query_id, status FROM information_schema.query_history WHERE status = 'CANCELED'; ``` - -## Caution - -Care should be taken when cancelling queries, as it may impact transactions and ongoing operations. Users should have a clear understanding of the query being canceled and its potential side effects. \ No newline at end of file