system-queries

Retrieves the status of all currently running queries.

Command properties

PropertyDescription
Command typeDriver query
Required permissionNone
License usageNot counted
Parallel executionNot supported
Distributed executionNot supported

Syntax

system-queries

Options

None

Output fields

FieldTypeDescription
idintegerQuery ID
sourcestringContext in which the query was created
login_namestringName of the account that ran the query
remote_ipipaddrIP address of the connection from which the query was run
is_endbooleanWhether the query has ended. true: ended, false: running
is_cancelledbooleanWhether the query was cancelled. true: cancelled, false: not cancelled
rowslongNumber of records returned by the query
elapsedlongQuery execution time (unit: milliseconds). Returns null if the query has not started.
query_stringstringQuery string
constantsmapMap of constants bound to the query
start_timelongQuery start time (epoch, milliseconds)
finish_timelongQuery end time (epoch, milliseconds)
backgroundbooleanWhether the query runs in the background. true: background query, false: not a background query
commandsmapExecution status per individual command
sub_queriesarrayList of sub-queries
tagsmapTags assigned to the query
stamplongQuery 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

  1. Retrieve all currently running queries

    system-queries
    

    Retrieves the status of all queries that are currently running or have recently completed.

  2. Retrieve only queries that have not yet ended

    system-queries | search is_end == false
    

    Filters and retrieves only queries that are currently running.

  3. Retrieve queries with the longest elapsed time

    system-queries | search isnotnull(elapsed) | sort -elapsed
    

    Sorts queries from longest to shortest execution time.