QUERYPERFORMANCEMETRICS System Table Description

Description

The QUERYPERFORMANCEMETRICS pseudo table shows metrics for all previous statements executed on this client’s connection across all Transaction Engines (TEs) within the current time period. The metrics are available only immediately after a statement is executed.

All statements are normalized by ignoring query parameters. The top metrics, which consist of statements that take the longest to execute, are written to the sql-statement-metrics logging category with the WARN logging level and logged to nuoadmin.log by default. The table is cleared periodically and does not persist indefinitely. By default, this occurs at the start of every hour.

Fields

Field Type Description

STATEMENT

string

Normalized SQL query string

COUNT

bigint

Number of times the statement was executed

MINEXECTIME

bigint

Minimum execution time in microseconds

MAXEXECTIME

bigint

Maximum execution time in microseconds

AVGEXECTIME

bigint

Average execution time in microseconds

TOTALEXECTIME

bigint

Total execution time in microseconds

MINCOMPILETIME

bigint

Minimum compile time in microseconds

MAXCOMPILETIME

bigint

Maximum compile time in microseconds

AVGCOMPILETIME

bigint

Average compile time in microseconds

TOTALCOMPILETIME

bigint

Total compile time in microseconds

RECORDSFETCHEDATMINTIME

bigInt

The total number of records fetched from tables and indices at minimum execution time

RECORDSFETCHEDATMAXTIME

bigInt

The total number of records fetched from tables and indices at maximum execution time

A null compile time indicates that a query was not compiled in the current time period but was retrieved from the compiled query cache.

Example

SELECT statement, count FROM system.queryperformancemetrics
WHERE statement LIKE '%MYTABLE794734%';
                            STATEMENT                            COUNT
 -------------------------------------------------------------- ------
  CREATE TABLE MYTABLE794734 (F1 INTEGER, F2 STRING, F3 BOOLEAN)   1
  INSERT INTO MYTABLE794734 VALUES (?, ?, ?)                       4
  SELECT COUNT(*) FROM MYTABLE794734 WHERE (F1) > (?)              6
  SELECT COUNT(*) FROM MYTABLE794734 WHERE (F3) = (?)              3