queries_*
The queries_* tables of the gpperfmon database store high-level query status information.
There are three tables with the same columns:
-
queries_nowis an external table whose data files are stored in $MASTER_DATA_DIRECTORY/gpperfmon/data. Current query status is stored inqueries_nowduring the period between data collection from thegpperfmonagents and automatic commit to thequeries_historytable. -
queries_tailis 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 fromqueries_nowbut has not yet been committed toqueries_history. It typically contains a few minutes worth of data. This table is for internal use only. -
queries_historyis 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 |
ssid |
int |
The session id as shown by |
ccnt |
int |
The command number within this session as shown by |
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 — |
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 |
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 |
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 |
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 — |