PGXC_INSTR_UNIQUE_SQL
PGXC_INSTR_UNIQUE_SQL视图展示集群中所有CN节点的Unique SQL的完整统计信息。
需要有系统管理员权限才可以访问此视图,该视图的字段与GS_INSTR_UNIQUE_SQL视图字段相同。具体的字段请参考表1。
名称 | 类型 | 描述 |
|---|---|---|
node_name | name | 接收SQL的CN节点名称。 |
node_id | integer | 节点ID,等同于pgxc_node表中node_id。 |
user_name | name | 用户名称。 |
user_id | oid | 用户ID。 |
unique_sql_id | bigint | 归一化的UNIQUE SQL ID。 |
query | text | 归一化的SQL文本。 |
n_calls | bigint | 成功执行次数。 |
min_elapse_time | bigint | SQL在数据库内的最小运行时间(单位:微秒)。 |
max_elapse_time | bigint | SQL在数据库内的最大运行时间(单位:微秒)。 |
total_elapse_time | bigint | SQL在数据库内的总运行时间(单位:微秒)。 |
n_returned_rows | bigint | 行活动-SELECT语句返回的结果集行数。 |
n_tuples_fetched | bigint | 行活动-随机扫描行(列存表/外表不统计)。 |
n_tuples_returned | bigint | 行活动-顺序扫描行(列存表/外表不统计)。 |
n_tuples_inserted | bigint | 行活动-插入行数。 |
n_tuples_updated | bigint | 行活动-更新行数。 |
n_tuples_deleted | bigint | 行活动-删除行数。 |
n_blocks_fetched | bigint | buffer的块访问次数,即物理读/IO。 |
n_blocks_hit | bigint | buffer的块命中次数,即逻辑读/Cache。 |
n_soft_parse | bigint | 软解析次数(缓存计划)。 |
n_hard_parse | bigint | 硬解析次数(生成计划)。 |
db_time | bigint | 有效的DB执行时间,包含等待时间、网络发送时间等,若查询执行涉及到多线程,DB_TIME是多个线程的DB_TIME之和(单位:微秒)。 |
cpu_time | bigint | CPU的执行时间,不包含sleep时间(单位:微秒)。 |
execution_time | bigint | 查询执行器内的SQL执行时间,DDL语句、以及某些不经过执行器执行的语句(例如Copy语句)不计数(单位:微秒)。 |
parse_time | bigint | SQL解析时间(单位:微秒)。 |
plan_time | bigint | SQL生成计划时间(单位:微秒)。 |
rewrite_time | bigint | SQL重写时间(单位:微秒)。 |
pl_execution_time | bigint | plpgsql过程化语言函数上的执行时间(单位:微秒)。 |
pl_compilation_time | bigint | plpgsql过程化语言函数上的编译时间(单位:微秒)。 |
net_send_time | bigint | 网络时间,包含CN向客户端发送数据、DN向CN发送数据等时间(单位:微秒)。 |
data_io_time | bigint | IO时间,文件IO耗时(单位:微秒)。 |
first_time | timestamp with time zone | 该SQL第一次执行的时间。 |
last_time | timestamp with time zone | 该SQL上一次执行的时间。 |

