暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

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

原创 eygle 2020-01-04
826

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

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

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> 


「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论