Skip to content

Commit

Permalink
Caution removed, sample query updated
Browse files Browse the repository at this point in the history
  • Loading branch information
dsporov authored and arushi-firebolt committed Feb 7, 2024
1 parent e3c4aa6 commit 3978d95
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions docs/sql_reference/commands/queries/cancel.md
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand All @@ -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.

0 comments on commit 3978d95

Please sign in to comment.