Updated on 2024-09-02 GMT+08:00

GS_QUERY_MONITOR

Displays the running/queuing information and resource usage of ongoing queries. Only queuing and running jobs are displayed. This view can be queried only on CNs and displays only the monitoring information about the main statement. This view is supported only by clusters of 8.2.1.100 and later versions.

Table 1 GS_QUERY_MONITOR columns

Column

Type

Description

usename

name

Name of the user who performs the query.

nodename

name

Name of the CN that executes the query.

nodegroup

name

Name of the cluster where the query is performed. The default cluster name is installation.

rpname

name

Name of the resource pool associated with the query.

priority

name

Priority of the query, which can be Rush, High, Medium, and Low.

xact_start

timestamp

Start time of the transaction to which the query belongs.

query_start

timestamp

Start time of query execution.

block_time

bigint

Accumulated queuing time of jobs. Stored procedures and multi-statement task may be queued for multiple times. Unit: second.

duration

bigint

Running time of a job, excluding the queuing time. Unit: second.

query_band

text

Job ID, which can be set using the GUC parameter query_band. By default, this parameter is left blank.

attribute

text

Job attributes:

  • Simple: simple job.
  • Complicated: complex job.

This column is invalid before a job is under resource pool management and control. This column is valid only when the job is under or has been under resource pool management and control.

lane

text

Resource pool lane where a job is queued or executed:

  • fast: fast lane.
  • slow: slow lane.

This column is invalid before a job is under resource pool management and control. This column is valid only when the job is under or has been under resource pool management and control.

status

text

Current status of a job. The value can be pending or running.

queue

text

Job queuing information:

  • None: The job is running.
  • Global: The job is queued in the global queue of the CN.
  • Respool: The job is queued in the resource pool.
  • CCN: The job is queued in the CCN.

used_mem

integer

Maximum peak memory usage of a job across all DNs. The unit is MB.

estimate_mem

integer

Estimated memory of a job. The unit is MB.

used_cpu

double precision

Average number of CPU cores occupied by a job since the job starts to run.

read_speed

integer

Average logical I/O read rate of a job on all DNs. The unit is KB/s.

write_speed

integer

Average logical I/O write rate of a job on all DNs. The unit is KB/s.

send_speed

integer

Average transmit rate on all DNs since a job starts to run. The unit is KB/s.

recv_speed

integer

Average receive rate on all DNs since a job starts to run. The unit is KB/s.

dn_count

bigint

Number of DNs that execute the job.

stream_count

bigint

Total number of stream threads of a job on all DNs.

pid

bigint

ID of the backend thread

lwtid

integer

Lightweight thread ID of a background thread.

query_id

bigint

Query ID.

unique_sql_id

bigint

ID of the normalized unique SQL.

query

text

Query that is being executed.