SHOW QUERIES command¶
The SHOW QUERIES command lists all queries that are currently running or being canceled by the user in the current Graph service. This is useful for identifying resource-intensive or long-running queries that may be consuming significant CPU resources.
Note
Only the user with the role ADMIN can view all queries that are currently running or being canceled by any user in the current Graph service. Other users can view only their own queries that are currently running or being canceled. For more information about roles, see Roles and privileges.
The SHOW QUERIES command returns the following columns to provide details about each query:
| Column | Description |
|---|---|
username |
The user who submitted the query. |
host |
The host from which the query was submitted. |
graph |
The schema path and name of the graph or temporary graph in the session in which the query was executed. If no graph or temporary graph is set for the current session, the value is either empty or corresponds to the schema path and name of the home graph set for the current user. |
session_id |
The ID of the session in which the query was executed. |
query_id |
The ID of the query. |
query |
The query statement. |
start_time |
The time when the query started executing. |
duration(ms) |
The duration of the query in milliseconds. |
status |
The status of the query. Possible values: RUNNING: The query is being executed.CANCELING: The query is being canceled. |
category |
The category of the query. Possible values: DDL: The Data Definition Language (DDL) statement.DML: The Data Manipulation Language (DML) statement.DQL: The Data Query Language (DQL) statement. |
Syntax¶
- show_queries_command
show_queries_command ::=
'SHOW' 'QUERIES'
Examples¶
Show all queries¶
SHOW QUERIES
Return:
+----------+--------------------+-----------------------+--------------------+---------------------------+--------------+-----------------------------+--------------+---------+----------+
| username | host | graph | session_id | query_id | query | start_time | duration(ms) | status | category |
+----------+--------------------+-----------------------+--------------------+---------------------------+--------------+-----------------------------+--------------+---------+----------+
| root | 192.168.8.185:9669 | /default_schema/movie | 302599629815594027 | 20250929_07414400000u3zqn | show queries | 2025-09-29T07:59:00.629000Z | 2 | RUNNING | DQL |
+----------+--------------------+-----------------------+--------------------+---------------------------+--------------+-----------------------------+--------------+---------+----------+