GaussDB T 基础入门:等待事件 的分类和数量等

举报
GaussDB小粉 发表于 2020/01/17 14:34:40 2020/01/17
【摘要】 等待事件是会话等待某个系统行为发生的事件。等待事件可能由许多因素引起,从磁盘上的慢速读/写,到架构引起的锁定情况,到各种系统资源争用。

等待事件是会话等待某个系统行为发生的事件。等待事件可能由许多因素引起,从磁盘上的慢速读/写,到架构引起的锁定情况,到各种系统资源争用。

等待是系统级或会话级的。会话级等待事件是影响数据库中单个用户活动的事件。系统级等待事件会影响整个数据库系统。用户可通过对等待事件进行分析来定位系统性能问题。

GaussDB T 提供了总共7大类等待事件:Idle、Concurrency、Other、Commit、Application、User I/O、Configuration,总共31种等待事件。

可通过DV_SESSION_EVENTS、DV_SESSION_WAITS查询会话级等待事件的统计信息,可通过DV_SYS_EVENTS查询系统级等待事件的统计信息。

Name                                Null?    Type                                
----------------------------------- -------- ------------------------------------
EVENT#                              NOT NULL BINARY_INTEGER                      
EVENT                               NOT NULL VARCHAR(64 BYTE)                    
P1                                 NOT NULL VARCHAR(64 BYTE)                    
WAIT_CLASS                            NOT NULL VARCHAR(64 BYTE)                    
TOTAL_WAITS                            NOT NULL BINARY_BIGINT                       
TIME_WAITED                            NOT NULL BINARY_BIGINT                       
TIME_WAITED_MIRCO                         NOT NULL BINARY_BIGINT                       
AVERAGE_WAIT                           NOT NULL BINARY_DOUBLE                       
AVERAGE_WAIT_MIRCO                        NOT NULL BINARY_BIGINT                       

SQL> select count(*) from DV_SYS_EVENTS;

COUNT(*)            
--------------------
31                  

1 rows fetched.

SQL> select event ,wait_class from dv_sys_events;

EVENT                                                            WAIT_CLASS                                                      
---------------------------------------------------------------- ----------------------------------------------------------------
idle wait                                                        Idle                                                            
message from client                                                   Idle                                                            
message to client                                                    Idle                                                            
latch: large pool                                                    Concurrency                                                     
latch: sql pool                                                     Concurrency                                                     
latch: lock pool                                                     Concurrency                                                     
latch: dictionary pool                                                  Concurrency                                                     
latch: data buffer pool                                                 Concurrency                                                     
latch: cache buffers chains                                               Concurrency                                                     
cursor: mutex                                                      Other                                                           
library : mutex                                                     Other                                                           
log file sync                                                      Commit                                                          
buffer busy waits                                                    Concurrency                                                     
enq: TX row lock contention                                               Application                                                     
enq: TX alloc itl entry                                                 Concurrency                                                     
enq: TX index contention                                                 Application                                                     
enq: TX table lock S                                                   Application                                                     
enq: TX table lock X                                                   Application                                                     
enq: TX read  wait                                                   Application                                                     
db file scattered read                                                  User/IO                                                         
db file sequential read                                                 User/IO                                                         
log file switch(checkpoint incomplete)                                          Configuration                                                   
log file switch(archiving needed)                                            Configuration                                                   
read by other session                                                  Concurrency                                                     
attached to agent                                                    Idle                                                            
heap find map                                                      Concurrency                                                     
heap extend segment                                                   Concurrency                                                     
resmgr: io quantum                                                    User/IO                                                         
direct path read temp                                                  User/IO                                                         
direct path write temp                                                  User/IO                                                         
advisory lock wait time                                                 Concurrency                                                     

31 rows fetched.

SQL>


转自墨天轮

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。