Wait Type:IO_COMPLETION
在等待 CXPACKET 完成的时间内,我查看 sys.dm_exec_requests ,发现Session的 Logical Read/Write, Physical Read 都没有变化。Waittype CXPACKET 表示SQL Server以并行方式执行Task,有一些 Task执行速度慢,有些Task执行速度快,导致执行速度快的task完成之后,等待还未完成的Task。那么,那些未完成的Task 为什么不进行IO?
利用 sys.dm_os_waiting_tasks 查看Request的所有Task,发现有一些Task 处于 IO_COMPLETION 等待,MSDN 官方文档的定义是:Occurs while waiting for I/O operations to complete. This wait type generally represents non-data page I/Os. Data page I/O completion waits appear as PAGEIOLATCH_* waits.
IO_COMPLETION 通常用于表示非数据页的IO操作(like a transaction log restore operation or the reading of bitmap pages, like the GAM page),这样看来, sys.dm_exec_requests 统计的是 Request对数据页的Logical Read/Write, Physical Read 操作。
1,引用《Causes of IO_COMPLETION and WRITE_COMPLETION SQL Server wait types》,Paul Randal 利用 Extended Event 分析 IO_COMPLETION 等待,枚举能够产生 IO_COMPLETION 等待的操作。
IO_COMPLETION:
- Reading log blocks from the transaction log (during any operation that causes the log to be read from disk – e.g. recovery)
 - Reading allocation bitmaps from disk (e.g. GAM, SGAM, PFS pages) during many operations (e.g. recovery, DB startup, restore)
 - Writing intermediate sort buffers to disk (these are called ‘Bobs’)
 - Reading and writing merge results from/to disk during a merge join
 - Reading and writing eager spools to disk
 - Reading VLF headers from the transaction log
 
2,减少IO_COMPLETION 等待
通常来说,减少IO_COMPLETION 等待的方法有两种:一是将IO分散到不同的Physical Disk上,一是减少对非数据页的IO操作。
引用 Pinal Dave 的《SQL SERVER – IO_COMPLETION – Wait Type – Day 10 of 28 》
Reducing IO_COMPLETION wait:
- Proper placing of the files is very important. We should check the file system for proper placement of files– LDF and MDF on a separate drive, TempDB on another separate drive, hot spot tables on separate filegroup (and on separate disk),etc.
 - Check the File Statistics and see if there is higher IO Read and IO Write Stall.
 - Check event log and error log for any errors or warnings related to IO.
 - It is very possible that there are no proper indexes in the system and there are lots of table scans and heap scans. Creating proper index can reduce the IO bandwidth considerably. If SQL Server can use appropriate cover index instead of clustered index, it can effectively reduce lots of CPU, Memory and IO (considering cover index has lesser columns than cluster table and all other; it depends upon the situation).
 
参考文档:
Causes of IO_COMPLETION and WRITE_COMPLETION SQL Server wait types
SQL SERVER – IO_COMPLETION – Wait Type – Day 10 of 28
Wait Type:IO_COMPLETION的更多相关文章
- SQL Server中与IO相关的等待类型:IO_COMPLETION和PAGEIOLATCH_*
		
一个大的SQL语句操作,执行计划中包含了一个merge join操作,观察到SQL长时间处于IO_COMPLETION等待状态,如果是读取相关的表的数据,服务器应该全力为其服务,但是服务器的物理IO又 ...
 - QueryRunner cannot be resolved to a type:关于包不能正常导入的问题
		
在操作一个功能模块的时候,出现一个问题: 我原则是按着项目指导一步一步走的,但却出现, QueryRunner cannot be resolved to a type,这个问题应该属于Xxx can ...
 - sklearn 调用逻辑回归函数训练数据时出现   “unknown label type:unknown”
		
problemsolution:
 - 数据源增量处理(Delta Proess)三大属性:Recod Mode、Delta Type、Serialization
		
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
 - 查看帮助文档的一些方法:help,dir,type,func_global等
		
help与dir与type:在使用python来编写代码时,会经常使用python自带函数或模块,一些不常用的函数或是模块的用途不是很清楚,这时候就需要用到help函数来查看帮助.这里要注意下,hel ...
 - 初识Haskell 二:基本操作符、类型Type、数据结构
		
对Discrete Mathematics Using a Computer的第一章Introduction to Haskell进行总结.环境Windows 1. 在安装了ghci后,便可以进行Ha ...
 - python 面向对象专题(六):元类type、反射、函数与类的区别、特殊的双下方法
		
目录 Python面向对象06 /元类type.反射.函数与类的区别.特殊的双下方法 1. 元类type 2. 反射 3. 函数与类的区别 4. 特殊的双下方法 1. 元类type type:获取对象 ...
 - 读书笔记:JavaScript DOM 编程艺术(第二版)
		
读完还是能学到很多的基础知识,这里记录下,方便回顾与及时查阅. 内容也有自己的一些补充. JavaScript DOM 编程艺术(第二版) 1.JavaScript简史 JavaScript由Nets ...
 - ABP源码分析二十五:EventBus
		
IEventData/EventData: 封装了EventData信息,触发event的源对象和时间 IEventBus/EventBus: 定义和实现了了一系列注册,注销和触发事件处理函数的方法. ...
 
随机推荐
- checked属性
			
使用checked属性,你可以设置复选按钮和单选按钮默认被选中. 为此,只需在input元素中添加属性checked <input type="radio" name=&qu ...
 - enum与字符串转换
			
public enum CacheControlMode { DisableCache, UseExpires } string s = CacheControlMode.UseExpires.ToS ...
 - linux mysql
			
安装mysql 1.使用rpm 安装mysql 或者使用yum安装 使用rpm 安装 下载 Centos 7 所需要的mysql包 tar -xf 解压整合包 根据依赖 安装 common>li ...
 - 【转】Chrome快捷键
			
感谢原作者:http://www.cnblogs.com/mikalshao/archive/2010/11/03/1868568.html 标签页和窗口快捷键 Ctrl+N 打开新窗口. Ctrl+ ...
 - Kinect v2.0 for windows开发环境说明
			
官方文档里是这些: Supported Operating Systems and Architectures The following operating systems and architec ...
 - 错误:Implicit super constructor xx() is undefined for default constructor. Must define an explicit constructor
			
错误:Implicit super constructor xx() is undefined for default constructor. Must define an explicit con ...
 - oracle数据库常用查询
			
一.数据库信息 1.数据库时间 select to_char(sysdate, 'yyyy-mm-dd hh24:mi:ss') AS dbtime from dual; 2.主机OS类型 SELEC ...
 - Java开发视频网站大概需要多少钱?
			
这个还真不好说,需要看你对视频网站有什么要求?你的数据库选择的是什么型号的?需要开发几个页面?服务器是需要高端的还是中低端的?还有你对完成时间有什么要求,这些细节也是决定价格的关键因素. 上面这些因素 ...
 - UILabel实现自适应高宽
			
UILabel是iOS开发常用的控件.UILabel的属性需要了解,UILabel的特殊显示效果也需要我们掌握.UILabel自适应高宽度是很多初学者遇到的技术性难题.比如段文字,要让他完全地分行显示 ...
 - Mac OS X 常用快捷键