Estimated and Actual Execution Plans
https://www.simple-talk.com/sql/performance/execution-plan-basics/
文章已经分析的很详细了,另外补充一些。当分析一个超复杂的存储过程时,例如一个存储过程中又调用了多个其他的存储过程,且每个都很复杂,涉及多个insert,update语句。执行计划具有以下特点:
1, 执行计划按执行的先后顺序打印出所有insert,update等语句的执行。例如在执行过程中进入了另一个存储过程,则传入这个存储过程中的语句。也就是说多个存储过程的执行计划按执行先后顺序穿插在一起。
2, Estimated Execution Plans有一个很大的局限性,那就是如果语句使用了临时表,则无法得到Estimated Execution Plans。原因是Estimated Execution Plan不会真正执行sql语句,所以无法得知临时表的统计数据。Actual Execution Plans则没有这个问题。
3,而Actual Execution Plans的问题是:你可以使用Estimated Execution Plans预估sql的执行情况,大家都知道查看Estimated Execution Plans是很快的。而Actual Execution Plans则需要真正去执行sql以得到结果,因此有时会非常慢。例如今天我想得到一个存储过程的完整执行计划(其中还调用了其他很多存储过程),运行时间大概是9小时。主要是其中某一个存储过程太慢导致的。此时为了得到完整的Actual Execution Plans,我不得不执行该sql,并等待了9小时才得到完整的Actual Execution Plans。期间可以看到随着sql的运行,新的insert\update等语句的执行计划被不断打印出来。
因此我们可以认为Actual Execution Plans其实就是sql实际运行的过程的统计数据。
Estimated and Actual Execution Plans相关推荐
- SQL调优指南笔记6:Explaining and Displaying Execution Plans
本文为SQL Tuning Guide第6章"解释和显示执行计划"的笔记. 了解如何解释SQL语句并显示其计划对于 SQL 调优至关重要. 重要基本概念 row source tr ...
- Execution Plan 执行计划介绍
后面的练习中需要下载 Demo 数据库, 有很多不同的版本, 可以根据个人需要下载. 下载地址 - http://msftdbprodsamples.codeplex.com/ 1. 什么是执行计划 ...
- SQL Server中的执行计划
介绍 (Introduction) In this article, I'm going to explain what the Execution Plans in SQL Server are a ...
- SQL Server查询存储–概述
The SQL Server Query Store is a relatively new feature introduced in SQL Server 2016. It is basicall ...
- 在Azure Data Studio中查看执行计划
This article gives an overview of viewing execution plans in the Azure Data Studio. 本文概述了在Azure Data ...
- sql server 入门_SQL Server查询调整入门
sql server 入门 This article will cover some essential techniques for SQL query tuning. Query tuning i ...
- mysql按照列构建索引_列存储索引增强功能–在线和离线(重新)构建
mysql按照列构建索引 In this article, we will explore ' Clustered columnstore online index build and rebuild ...
- sql查询初学者指南_面向初学者SQL Server查询执行计划–类型和选项
sql查询初学者指南 When a DBA is working with the SQL Server, he/she might sometimes say that the execution ...
- sql查询初学者指南_适用于初学者SQL Server查询优化技巧与实际示例
sql查询初学者指南 In this article, we will continue to learn essential techniques of the SQL Server query t ...
最新文章
- java正则截取xml节点_实例讲述Java使用正则表达式截取重复出现的XML字符串功能...
- 小shell脚本---查找目录下面包含string的文件
- python3.x下 smtp发送html邮件和附件
- python 自定义词典_pyhanlp用户自定义词典添加
- Tomcat创建一个windows服务
- ubuntu / 18.04 系统上配置 DHCP Server
- 定时器实现方式之TimerTask、Timer
- 系统--把系统BIOS中将光驱设置为第一启动盘
- linux 下 svn的安装和使用
- SwiftUI AsyncImage cancelled 无法加载图片
- 人工智能迎来寒冬,自动驾驶汽车发展受阻
- oracle 查看日志组切换状态_【DB笔试面试800】在Oracle中,归档和非归档模式之间的不同点是什么?它们各自的优缺点是什么?...
- du-查看文件夹大小-并按大小进行排序
- JavaWeb项目开发案例精粹-第3章在线考试系统-003Dao层
- 【经验】面对感冒引起的发烧怎么办,总结一些有用的经验
- 手机QQ与Win8:一蠢再蠢的改版与回炉
- iOS中Instrument的使用
- Eclipse方式: Processes that Adapt (part I)
- STM32 自定义HID USB设备的实现
- 巫师3储物箱在哪_巫师3全宝藏宝箱地图分享 各种宝藏的具体位置