Redshift: CANCEL Canceling a Query


CANCEL

To cancel a query, find out the PID of the query using STV_RECENTS and then issue CANCEL

SQL> select * from STV_RECENTS where STATUS ='Running'

Find out the PID of your query then issue CANCEL Command.

SQL> cancel 14742;

CANCEL will not abort the transaction, you have to issue ABORT command.


- You can issue the CANCEL from different session but using the same User.

- If the current user has lot of quiers running, then he cannot issue any more query until one of his query completes. In this case you can use different workload management query queue to issue CANCEL command.

Workload manager creates a queue called Superuser Queue which can be used for troubleshooting, but you need to login as superuser.

SQL> set query_group to 'superuser'
SQL> cancel 14742;
SQL> reset query_group;

Comments