原始采集项
采集说明
采集字段 |
类 型 |
含义 |
db_name |
varchar |
数据库名称 |
inst_name |
varchar |
实例名称 |
pid |
varchar |
线程id(会话id,session id) |
query_id |
varchar |
语句执行使用的内部query_id |
query_band |
varchar |
用于标示作业类型,可通过guc参数query_band进行设置,默认为空字符串 |
job_name |
varchar |
这个值是从query_band的字段中取出来的,位置0 |
job_inst |
varchar |
这个值是从query_band的字段中取出来的,位置1 |
user_name |
varchar |
连接到后端的用户名 |
application_name |
varchar |
连接到后端的应用名 |
client_address |
text |
连接到后端的客户端的ip地址,如果此字段是null,它表明通过服务器机器上unix套接字连接客户端或者这是内部进程,如autovacuum |
client_hostname |
text |
客户端的主机名,这个字段是通过client_addr的反向dns查找得到。这个字段只有在启动log_hostname且使用ip连接时才非空 |
client_port |
text |
客户端用于与后端通讯的tcp端口号,如果使用unix套接字,则为-1 |
waiting |
boolean |
如果后台当前正等待锁则为true |
start_time |
bigint |
语句执行的开始时间 |
block_time |
bigint |
语句执行前的阻塞时间 (单位ms) |
duration |
bigint |
语句已经执行的时间 (单位ms) |
estimate_total_time |
bigint |
语句执行预估总时间 (单位ms) |
estimate_left_time |
bigint |
语句执行预估剩余时间 (单位ms) |
enqueue |
varchar |
工作负载管理资源状态 |
resource_pool |
varchar |
用户使用的资源池 |
control_group |
varchar |
语句所使用的cgroup |
min_peak_memory |
int4 |
语句在所有dn上的最小内存峰值 (单位mb) |
max_peak_memory |
int4 |
语句在所有dn上的最大内存峰值 (单位mb) |
average_peak_memory |
int4 |
语句执行过程中的内存使用平均值 (单位mb) |
memory_skew_percent |
int4 |
语句在各dn间的内存使用倾斜率 |
estimate_memory |
int4 |
语句预估使用内存 (单位mb) |
spill_info |
varchar |
语句在所有dn上的下盘信息 |
min_spill_size |
int4 |
若发生下盘,所有dn上下盘的最小数据量 (单位mb) 默认为0 |
max_spill_size |
int4 |
若发生下盘,所有dn上下盘的最大数据量 (单位mb) 默认为0 |
average_spill_size |
int4 |
若发生下盘,所有dn上下盘的平均数据量 (单位mb) 默认为0 |
spill_skew_percent |
int4 |
若发生下盘,dn间下盘倾斜率 |
min_dn_time |
bigint |
语句在所有dn上的最小执行时间 (单位ms) |
max_dn_time |
bigint |
语句在所有dn上的最大执行时间 (单位ms) |
average_dn_time |
bigint |
语句在所有dn上的平均执行时间 (单位ms) |
dntime_skew_percent |
int4 |
语句在各dn间的执行时间倾斜率 |
min_cpu_time |
bigint |
语句在所有dn上的最小cpu时间 (单位ms) |
max_cpu_time |
bigint |
语句在所有dn上的最大cpu时间 (单位ms) |
total_cpu_time |
bigint |
语句在所有dn上的cpu总时间 (单位ms) |
cpu_skew_percent |
int4 |
语句在各dn间的cpu时间倾斜率 |
warning |
text |
主要显示如下几类告警信息以及sql自诊断调优相关告警 |
average_peak_iops |
int4 |
语句在所有dn上的每秒平均io峰值(列存单位是次/s,行存单位是万次/s) |
iops_skew_percent |
int4 |
语句在dn间的io倾斜率 |
max_peak_iops |
int4 |
语句在所有dn上的每秒最大io峰值(列存单位是次/s,行存单位是万次/s) |
min_peak_iops |
int4 |
语句在所有dn上的每秒最小io峰值(列存单位是次/s,行存单位是万次/s) |
query |
text |
查询语句 |
query_plan |
text |
查询计划 |
query_status |
text |
当前查询语句的实时运行状态 (active idle idle in transaction idle in transaction(aborted) fastpath function call disabled) |
wlm_status |
text |
当前查询语句在资源池上的运行状态 (pending running finished aborted active unknown) |
wlm_attrib |
text |
语句的属性 (ordinary simple complicated internal) |
lane |
varchar |
快慢车道 (fast or slow) |
页面呈现
概览页面
聚合指标说明
聚合指标名称 |
指标说明 |
计算方式 |
运行 |
处于运行中查询的数量 |
state = ‘active’ state = ‘fastpath function call’ 为了保证数据一致性,这里还需要减掉阻塞和延迟的查询数量。 |
阻塞 |
处于阻塞中查询的数量 |
state = ‘active’ and waiting = ‘t’ |
取消 |
后端在事务中,但事务中有语句执行失败 |
state = ‘idle in transaction (aborted)’ |
延迟 |
查询正在排队等待执行 |
state = ‘active’ and enqueue is not NULL |
快慢车道 |
处于快车道中的查询和处于慢车道中的查询数量 |
lane = ‘fast’ lane = ‘slow’ |
查询详情
查询详情条目说明
指标名称 |
指标描述 |
基本信息 |
该查询的基本信息:用户名,数据库,开始时间,预估执行时间等等 |
调优警告 |
该语句触发的内核调优告警,没有的话返回空 |
实时资源消耗 |
展示SQL执行过程中,CPU,内存,I/O下盘量指标的变化趋势(该页面仅实时查询下钻显示) |
历史资源消耗 |
展示SQL执行过程中,CPU,内存,I/O下盘量指标的变化趋势 |
查询语句 |
该查询所执行的SQL语句 |
查询计划 |
该查询的语句的查询计划 |
openAPI (华为云未上线)
/v1/{project_id}/dms/clusters/{cluster_id}/query
{
"queries": [
{
"query": "select count(*) \r\nfrom store_sales\r\n ,household_demographics \r\n ,time_dim, store\r\nwhere ss_sold_time_sk = time_dim.t_time_sk \r\n and ss_hdemo_sk = household_demographics.hd_demo_sk \r\n and ss_store_sk = s_store_sk\r\n and time_dim.t_hour = 8\r\n and time_dim.t_minute >= 30\r\n and household_demographics.hd_dep_count = 5\r\n and store.s_store_name = 'ese'\r\norder by count(*)\r\nlimit 100;",
"max_cpu_time": 0,
"min_cpu_time": 0,
"total_cpu_time": 0,
"cpu_skew": 0,
"max_peak_mem": 11,
"min_peak_mem": 11,
"avg_peak_mem": 11,
"mem_skew": 0,
"max_spill_size": 0,
"min_spill_size": 0,
"avg_spill_size": 0,
"spill_skew": 0,
"max_peak_iops": 0,
"min_peak_iops": 0,
"avg_peak_iops": 0,
"iops_skew": 0,
"db_name": "test",
"application": "gsql",
"query_id": "79657418412457882"
},
{
"query": "WITH web_v1 as (\r\nselect\r\n ws_item_sk item_sk, d_date,\r\n sum(sum(ws_sales_price))\r\n over (partition by ws_item_sk order by d_date rows between unbounded preceding and current row) cume_sales\r\nfrom web_sales\r\n ,date_dim\r\nwhere ws_sold_date_sk=d_date_sk\r\n and d_month_seq between 1212 and 1212+11\r\n and ws_item_sk is not NULL\r\ngroup by ws_item_sk, d_date),\r\nstore_v1 as (\r\nselect\r\n ss_item_sk item_sk, d_date,\r\n sum(sum(ss_sales_price))\r\n over (partition by ss_item_sk order by d_date rows between unbounded preceding and current row) cume_sales\r\nfrom store_sales\r\n ,date_dim\r\nwhere ss_sold_date_sk=d_date_sk\r\n and d_month_seq between 1212 and 1212+11\r\n and ss_item_sk is not NULL\r\ngroup by ss_item_sk, d_date)\r\n select *\r\nfrom (select item_sk\r\n ,d_date\r\n ,web_sales\r\n ,store_sales\r\n ,max(web_sales)\r\n over (partition by item_sk order by d_date rows between unbounded preceding and current row) web_cumulative\r\n ,max(store_sales)\r\n over (partition by item_sk order by d_date rows between unbounded preceding and current row) store_cumulative\r\n from (select case when web.item_sk is not null then web.item_sk else store.item_sk end item_sk\r\n ,case when web.d_date is not null then web.d_date else store.d_date end d_date\r\n ,web.cume_sales web_sales\r\n ,store.cume_sales store_sales\r\n from web_v1 web full outer join store_v1 store on (web.item_sk = store.item_sk\r\n and web.d_date = store.d_date)\r\n )x )y\r\nwhere web_cumulative > store_cumulative\r\norder by item_sk\r\n ,d_date\r\nlimit 100;",
"max_cpu_time": 487,
"min_cpu_time": 1,
"total_cpu_time": 1435,
"cpu_skew": 50,
"max_peak_mem": 37,
"min_peak_mem": 21,
"avg_peak_mem": 28,
"mem_skew": 24,
"max_spill_size": 0,
"min_spill_size": 0,
"avg_spill_size": 0,
"spill_skew": 0,
"max_peak_iops": 0,
"min_peak_iops": 0,
"avg_peak_iops": 0,
"iops_skew": 0,
"db_name": "test",
"application": "gsql",
"query_id": "79657418412457869"
}
],
"timestamp": 1616679496270,
"cluster_id": "9c11a33a-64e6-40c1-93bd-01b2255b2228"
}
想了解GuassDB(DWS)更多信息,欢迎微信搜索“GaussDB DWS”关注微信公众号,和您分享最新最全的PB级数仓黑科技,后台还可获取众多学习资料哦~
(完)