STV_WLM_QUERY_STATE
Records the current state of queries being tracked by WLM.
STV_WLM_QUERY_STATE is visible to all users. Superusers can see all rows; regular users can see only their own data. For more information, see Visibility of data in system tables and views.
Table columns
Column name | Data type | Description |
---|---|---|
xid | integer | Transaction ID of the query or subquery. |
task | integer | ID used to track a query through the workload manager. Can be associated with multiple query IDs. If a query is restarted, the query is assigned a new query ID but not a new task ID. |
query | integer | Query ID. If a query is restarted, the query is assigned a new query ID but not a new task ID. |
service_class | integer | ID for the service class. For a list of service class IDs, see WLM service class IDs. |
slot_count | integer | Number of WLM query slots. |
wlm_start_time | timestamp | Time that the query entered the system table queue or short query queue. |
state | character(16) | Current state of the query or subquery.
Possible values are the following:
|
queue_time | bigint | Number of microseconds that the query has spent in the queue. |
exec_time | bigint | Number of microseconds that the query has been running. |
query_priority | char(20) | The priority of the query. Possible values are
n/a , lowest , low ,
normal , high , and
highest , where n/a means that query
priority isn't supported. |
Sample query
The following query displays all currently executing queries in service classes greater than 4. For a list of service class IDs, see WLM service class IDs.
select xid, query, trim(state) as state, queue_time, exec_time from stv_wlm_query_state where service_class > 4;
This query returns the following sample output:
xid | query | state | queue_time | exec_time -------+-------+---------+------------+----------- 100813 | 25942 | Running | 0 | 1369029 100074 | 25775 | Running | 0 | 2221589242