zoukankan      html  css  js  c++  java
  • SQL Server等待事件新解

         资源等待类型 

        并行:CXPACKET 

        Buffer:PAGEIOLATCH_X 

       非Buffer:LATCH_X  

       I/O:ASYNC_IO_COMPITION;IO_COMPITION  

      CPU:SOS_SCHEDULER_YIELD

      日志:WRITELOG&LOGBUFFER   
      锁阻塞:LCK_

     内存:RESOURCE_SEMAPHORE

     外部:PREEMPTIVE_XXX

     备份:DISKIO_SUSPENDE

    等待事件: ASYNC_NETWORK_IO

     清空当前等待事件统计  :  DBCC SQLPERF ('sys.dm_os_wait_stats', CLEAR); 

           说明:  该SQL查询有查出大量的数据行或者是大量数据,如(text 或者 varchar(max) 字段)

        等待事件: HADR_SYNC_COMMIT

          说明: 实时备库可能有很耗CPU的sql

        等待事件: WRITELOG

          说明: 数据库的写入量比较大

        等待事件: LATCH_EX [ACCESS_METHODS_DATASET_PARENT]

         说明:查询没有索引,需要回表查数据

                  LATCH_EX:Exclusive Latch,表明数据正在被改变或添加。两个EX Latch不能同时保留在用一个页上

          查看sys.dm_os_wait_stats的内容,你会看到LATCH_, PAGELATCH_ 和PAGEIOLATCH_打头的Latch,

            其中LATCH_打头的等待都是用于Non-BUF类型,

            PAGELATCH_打头的Latch应用于各种页,

            PAGEIOLATCH_打头的Latch用于数据从磁盘移到RAM。

      

    Other information:

    A latch is a lightweight synchronization mechanism that provides synchronization between threads trying to read or change a data structure in SQL Server. There are three types of latches:

    • Latches on pages being read from disk (these are covered by the PAGEIOLATCH_XX wait types – see the PAGEIOLATCH_SH wait type for more details)
    • Latches on pages already in memory (these are covered by the PAGELATCH_XX wait types – see the PAGELATCH_EX wait type for more details)
    • Latches on non-page data structures (i.e. everything else)

    The LATCH_SH and LATCH_EX wait types occur when a thread requires access to a non-page data structure (e.g., page buffers in the buffer pool (latch type = BUFFER), or the data structure that represents a database’s data and log files (latch type = FGCB_ADD_REMOVE)).

          https://blog.csdn.net/burgess_liu/article/details/19607151

  • 相关阅读:
    Leetcode 16.25 LRU缓存 哈希表与双向链表的组合
    Leetcode437 路径总和 III 双递归与前缀和
    leetcode 0404 二叉树检查平衡性 DFS
    Leetcode 1219 黄金矿工 暴力回溯
    Leetcode1218 最长定差子序列 哈希表优化DP
    Leetcode 91 解码方法
    Leetcode 129 求根到叶子节点数字之和 DFS优化
    Leetcode 125 验证回文串 双指针
    Docker安装Mysql记录
    vmware虚拟机---Liunx配置静态IP
  • 原文地址:https://www.cnblogs.com/zping/p/11060497.html
Copyright © 2011-2022 走看看