Estimated and Actual Execution Plans
来源:互联网 发布:淘宝阿里旺旺号那里看 编辑:程序博客网 时间:2024/05/16 03:58
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
- PLAN_HASH_VALUE - How equal (and stable?) are your execution plans - part 1
- 高效SQL查询之Graphical Execution Plans
- 将XML execution plans转换为图形界面GUI
- 【Oracle 优化器】自适应执行计划(Adaptive Execution Plans)
- [Dynamic AX] Static and Dynamic Master Plans
- Maintaining Consumer Groups, Plans, and Directives
- 简译《Dissecting SQL Server Execution Plans》——连载总入口
- 剖析 sql server 执行计划(Dissecting SQL Server Execution Plans) 1.1
- 053-7 When executing a SQL workload, you choose to generate execution plans only, without collecting
- SSMS – Performance Tuning using graphical execution plans - Missing indexes hints
- A Storm is coming: more details and plans for release
- MANUFACTURING PLANNING AND EXECUTION
- MANUFACTURING PLANNING AND EXECUTION
- Attractiveness and task execution
- Background Execution and Multitasking
- execution context and scope
- iPhone UIWebView Estimated Progress
- 如何判断子进程已启动
- 高性能前端~高性能HTML
- 关于android 签名系统的理解
- linux文件truncate命令
- MYSQL-常用SQL
- Estimated and Actual Execution Plans
- 忘交电费
- Java的新I/O(java.nio包)
- Floodlight 安装 配置 curl命令 添加流 删除流
- 用Merge代替复杂的Update
- UVA 11174 - Stand in a Line (数学基础+除法取模)
- SQL语句中CASE WHEN用法
- ubuntu 按照日期自动备份
- 如何简单判断一个数是否为素数?