Updated on 2024-11-05 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 PGXC_INSTR_UNIQUE_SQL.

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

Total database processing duration, encompassing wait and network transmission times. If multiple threads are involved in query execution, DB_TIME is the sum of the DB_TIME of multiple threads. The unit is microsecond.

cpu_time

bigint

CPU execution time, excluding the sleep time. The unit is microsecond.

execution_time

bigint

SQL statement execution time in the query executor. DDL statements and statements that are not executed by the executor (such as Copy statements) are not counted. The unit is microsecond.

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. The unit is microsecond.

first_time

timestamp with time zone

First execution time of the SQL statement

last_time

timestamp with time zone

Last execution time of the SQL statement