system-queries
Retrieves the status of all currently running queries.
Command properties
| Property | Description |
|---|---|
| Command type | Driver query |
| Required permission | None |
| License usage | Not counted |
| Parallel execution | Not supported |
| Distributed execution | Not supported |
Syntax
system-queries
Options
None
Output fields
| Field | Type | Description |
|---|---|---|
| id | integer | Query ID |
| source | string | Context in which the query was created |
| login_name | string | Name of the account that ran the query |
| remote_ip | ipaddr | IP address of the connection from which the query was run |
| is_end | boolean | Whether the query has ended. true: ended, false: running |
| is_cancelled | boolean | Whether the query was cancelled. true: cancelled, false: not cancelled |
| rows | long | Number of records returned by the query |
| elapsed | long | Query execution time (unit: milliseconds). Returns null if the query has not started. |
| query_string | string | Query string |
| constants | map | Map of constants bound to the query |
| start_time | long | Query start time (epoch, milliseconds) |
| finish_time | long | Query end time (epoch, milliseconds) |
| background | boolean | Whether the query runs in the background. true: background query, false: not a background query |
| commands | map | Execution status per individual command |
| sub_queries | array | List of sub-queries |
| tags | map | Tags assigned to the query |
| stamp | long | Query stamp value |
Error codes
Parsing errors
N/A
Runtime errors
N/A
Description
The system-queries command retrieves the status of queries that are currently running or have recently completed in the system.
Users with administrator permission can view queries from all accounts. Users without administrator permission can only view queries run under their own account.
Examples
-
Retrieve all currently running queries
system-queriesRetrieves the status of all queries that are currently running or have recently completed.
-
Retrieve only queries that have not yet ended
system-queries | search is_end == falseFilters and retrieves only queries that are currently running.
-
Retrieve queries with the longest elapsed time
system-queries | search isnotnull(elapsed) | sort -elapsedSorts queries from longest to shortest execution time.