Hello, I’m DocuDroid!
Submitting feedback
Thank you for rating our AI Search!
We would be grateful if you could share your thoughts so we can improve our AI Search for you and other readers.
GitHub

queries_*

The queries_* tables of the gpperfmon database store high-level query status information. There are three tables with the same columns:

  • queries_now is an external table whose data files are stored in $MASTER_DATA_DIRECTORY/gpperfmon/data. Current query status is stored in queries_now during the period between data collection from the gpperfmon agents and automatic commit to the queries_history table.

  • queries_tail is an external table whose data files are stored in $MASTER_DATA_DIRECTORY/gpperfmon/data. This is a transitional table for query status data that has been cleared from queries_now but has not yet been committed to queries_history. It typically contains a few minutes worth of data. This table is for internal use only.

  • queries_history is a regular table that stores historical query status data. It is partitioned into monthly partitions. Partitions are automatically added in two-month increments as needed.

The tmid, ssid, and ccnt columns are the composite key that uniquely identifies a particular query.

Column Type Description

ctime

timestamp

Time this row was created

tmid

int

A time identifier for a particular query. All records associated with the query will have the same tmid

ssid

int

The session id as shown by gp_session_id. All records associated with the query will have the same ssid

ccnt

int

The command number within this session as shown by gp_command_count. All records associated with the query will have the same ccnt

username

varchar(64)

Greengage DB role name that issued this query

db

varchar(64)

Name of the database queried

cost

int

Query cost (not implemented in current versions)

tsubmit

timestamp

Time the query was submitted

tstart

timestamp

Time the query was started

tfinish

timestamp

Time the query finished

status

varchar(64)

Status of the query — start, done, or abort

rows_out

bigint

Rows out for the query

cpu_elapsed

bigint

CPU usage by all processes across all segments executing this query (in seconds). It is the sum of the CPU usage values taken from all active primary segments in the database system.

Note that the value is logged as 0 if the query runtime is shorter than the value of the quantum gpperfmon configuration parameter. This occurs even if the query runtime is greater than the value for min_query_time

cpu_currpct

float

Current CPU percent average for all processes executing this query. The percentages for all processes running on each segment are averaged, and then the average of all those values is calculated to render this metric.

Current CPU percent average is always zero in historical and tail data

skew_cpu

float

Displays the amount of processing skew in the system for this query. Processing (or CPU) skew occurs when one segment performs a disproportionate amount of processing for a query. This value is the coefficient of variation of the CPU usage across all segments for this query, in percent, multiplied by 100. For example, a value of 0.95 is shown as 95

skew_rows

float

Displays the amount of row skew in the system. Row skew occurs when one segment produces a disproportionate number of rows for a query. This value is the coefficient of variation for the rows_in metric across all segments for this query, multiplied by 100. For example, a value of 0.95 is shown as 95

query_hash

bigint

Not implemented in current versions

query_text

text

The SQL text of this query

query_plan

text

Text of the query plan (not implemented in current versions)

application_name

varchar(64)

The name of the application

rsqname

varchar(64)

If the resource queue-based resource management scheme is active, this column specifies the name of the resource queue

rqppriority

varchar(64)

If the resource queue-based resource management scheme is active, this column specifies the priority of the query — max, high, med, low, or min