Skip to content

Commit

Permalink
more fixes
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 b77606f commit e3c4aa6
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions docs/sql_reference/commands/queries/cancel.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ parent: Queries

# CANCEL QUERY

The `CANCEL QUERY` statement is used to cancel a running query within the Firebolt engine. This statement provides a mechanism to terminate the execution of a specific query identified by its unique query_id.
The `CANCEL QUERY` statement is used to cancel a running query within the Firebolt engine. This statement provides a mechanism to terminate the execution of a specific query identified by its unique `query_id`.

## Syntax

Expand All @@ -35,7 +35,7 @@ CANCEL QUERY WHERE query_id = '12345';

## Example Use Case

Suppose 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:
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;
```
Expand All @@ -44,13 +44,11 @@ Suppose the long-running query is identified with query_id '12345':
```sql
CANCEL QUERY WHERE query_id = '12345';
```
This will initiate the cancellation process for the specified query_id. While the query is not completely terminated, its status in `information_schema.running_queries` can be observed as `CANCELING`.
Once the query is canceled, it disappears from running_queries. Its status in `information_schema.query_history`:
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;
```
will be observed as `CANCELED`.


## Caution

Expand Down

0 comments on commit e3c4aa6

Please sign in to comment.