TERMINATE QUERY

Syntax

TERMINATE QUERY query_id;

Description

For an existing query, TERMINATE QUERY will stop and delete the query specified by query_id. Note that this does not delete any Topics or Relations created by the query. Also note that once a query is terminated, it is deleted and cannot be restarted. A terminated query must be recreated using one of the Query statements.

TERMINATE QUERY cannot be undone. Use it with care!

Arguments

query_id

This specifies the unique identifier of the query to terminate. See LIST QUERIES to find out how to list all queries that the user has access to. The first column (ID) in the response corresponds with the query_id.

Examples

Terminate a query

The following is an example of how to terminate a query. Note the ID from LIST QUERIES is the same as the query_id used in TERMINATE QUERY.

demo_db.public/demostore# LIST QUERIES;
                   ID                  |  State  |                             DSQL                             |  Owner   |      Created at      |      Updated at
---------------------------------------+---------+--------------------------------------------------------------+----------+----------------------+-----------------------
  3d716a1a-1c38-4a18-9365-9def343731b8 | RUNNING | CREATE STREAM pageviews2 AS                                  | sysadmin | 2023-02-08T02:11:08Z | 2023-02-08T02:11:08Z
                                       |         | SELECT * FROM pageviews;

demo_db.public/demostore# TERMINATE QUERY 3d716a1a-1c38-4a18-9365-9def343731b8;
demo_db.public/demostore# LIST QUERIES;
  ID | State |                             DSQL                             | Owner | Created at | Updated at
-----+-------+--------------------------------------------------------------+-------+------------+-------------

Last updated