Skip to main content
Skip table of contents

Query Management

SYSADMIN.killQuery

This procedure kills a running query by id from the relevant system table: SYSLOG.QueryLogs for versions up to 25.2 or SYSLOG.ActiveQueries for versions 25.2 and higher:

SQL
CALL SYSADMIN.killQuery(IN id biginteger NOT NULL)

When you call the killQuery() system procedure, a cancel request is sent to the system. Once a query is marked as cancelled, it is killed as soon as possible.

Here is an example:

1. In versions up to 25.2:

SQL
SELECT * FROM SYSLOG.QueryLogs ;;
-- use the "id" from the result
CALL SYSADMIN.killQuery(1) ;;

2. In version 25.2 and higher:

SQL
SELECT * FROM SYSLOG.ActiveQueries ;;
-- use the "id" from the result
CALL SYSADMIN.killQuery(1) ;;

SYSADMIN.killSession

This procedure kills a session by id:

SQL
SYSADMIN.killSession(IN sessionId string NOT NULL)

When you call the killSession() system procedure, a cancel request is sent to the system, and the session is killed as soon as possible.

Here is an example:

1. In versions up to 25.2:

SQL
SELECT * FROM SYSLOG.QueryLogs ;;
-- use the "sessionId" from the result
CALL SYSADMIN.killSession('njWUGSusn8rz') ;;

2. In version 25.2 and higher:

SQL
SELECT * FROM SYSLOG.ActiveQueries ;;
-- use the "sessionId" from the result
CALL SYSADMIN.killSession('njWUGSusn8rz') ;;
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.