Updated on 2024-12-19 GMT+08:00

PGXC_INSTR_UNIQUE_SQL

PGXC_INSTR_UNIQUE_SQL displays the complete Unique SQL statistics of all CN nodes in the cluster.

Only the system administrator can access this view. The columns in this view are the same as those in the GS_INSTR_UNIQUE_SQL view. For details about columns in the view, see Table 1.

Table 1 GS_INSTR_UNIQUE_SQL columns

Name

Type

Description

node_name

name

Name of the CN that receives SQL statements

node_id

integer

Node ID, which is the same as the value of node_id in the pgxc_node table

user_name

name

Username

user_id

oid

User ID

unique_sql_id

bigint

Normalized Unique SQL ID

query

text

Normalized SQL text

n_calls

bigint

Number of successful execution times

min_elapse_time

bigint

Minimum running time of the SQL statement in the database (unit: μs)

max_elapse_time

bigint

Maximum running time of SQL statements in the database (unit: μs)

total_elapse_time

bigint

Total running time of SQL statements in the database (unit: μs)

n_returned_rows

bigint

Row activity - Number of rows in the result set returned by the SELECT statement

n_tuples_fetched

bigint

Row activity - Randomly scan rows (column-store tables/foreign tables are not counted.)

n_tuples_returned

bigint

Row activity - Sequential scan rows (Column-store tables/foreign tables are not counted.)

n_tuples_inserted

bigint

Row activity - Inserted rows

n_tuples_updated

bigint

Row activity - Updated rows

n_tuples_deleted

bigint

Row activity - Deleted rows

n_blocks_fetched

bigint

Block access times of the buffer, that is, physical read/I/O

n_blocks_hit

bigint

Block hits of the buffer, that is, logical read/cache

n_soft_parse

bigint

Number of soft parsing times (cache plan)

n_hard_parse

bigint

Number of hard parsing times (generation plan)

db_time

bigint

Valid DB execution time, including the waiting time and network sending time. If multiple threads are involved in query execution, the value of DB_TIME is the sum of DB_TIME of multiple threads (unit: μs).

cpu_time

bigint

CPU execution time, excluding the sleep time (unit: μs)

execution_time

bigint

SQL execution time in the query executor, DDL statements, and statements (such as Copy statements) that are not executed by the executor are not counted (unit: μs).

parse_time

bigint

SQL parsing time (unit: μs)

plan_time

bigint

SQL generation plan time (unit: μs)

rewrite_time

bigint

SQL rewriting time (unit: μs)

pl_execution_time

bigint

Execution time of the plpgsql procedural language function (unit: μs)

pl_compilation_time

bigint

Compilation time of the plpgsql procedural language function (unit: μs)

net_send_time

bigint

Network time, including the time spent by the CN in sending data to the client and the time spent by the DN in sending data to the CN (unit: μs)

data_io_time

bigint

File I/O time (unit: μs)

first_time

timestamp with time zone

Time of the first SQL statement execution

last_time

timestamp with time zone

Time of the last SQL statement execution