这次,您将看到相同的访问计划。
清单13展示了新的访问计划。
DB2优化器可以创建访问计划。
这样就完成了访问计划中的所有操作。
清单12展示了访问计划的基本组件。
访问反向文本索引的查询的访问计划。
访问hash索引的查询的访问计划。
这是相当高效的访问计划。
访问计划可以根据累积的数据进行更改。
查看访问计划有三种方法。
使用访问计划信息帮助优化sql语句。
Use access plan information to help optimize SQL statements.
运行db2exfmt生成访问计划
准备阶段的访问计划创建需要CPU资源。
Access plan creation in the prepare phase requires CPU resources.
现在,查看访问计划。
首先选择一组您想要影响其访问计划的查询。
First choose a set of queries whose access plans you have decided to influence.
在这种情况下,DB 2不会重用访问计划。
了解如何使用访问计划信息优化sql语句。
Learn to use access plan information to understand how to optimize your SQL statements.
这将导致更精确的成本计算和更优的访问计划。
This will result in more accurate costing, and more optimal access plan.
访问计划重用的另一个好处是CPU负载减小。
Another advantage of access plan reuse is a reduced CPU load.
清单11展示了select语句的访问计划。
然而,使用参数标记时,将生成另一个访问计划。
Nevertheless, another access plan is generated when parameter markers are used.
您在测试中获得了一个不同于生产中的访问计划。
不管使用哪种方法,都可以生成和显示访问计划。
Either way you provide the query and the access plan is generated and shown to you.
收集数据分布的统计信息,然后再次生成访问计划。
Collect distribution statistics and then generate the access plan again.
在编译语句时,语句的访问计划被存储在包缓存中。
When the statement is compiled, its access plan is stored in the package cache.
好的访问计划对于sql语句的快速执行至关重要。
A good access plan is key for the fast execution of an SQL statement.
例如,您可能很少被要求分析sql语句的访问计划。
For instance, you may rarely, if ever, be required to analyze the access plans for SQL statements.
这些不同的方法就是众所周知的访问路径或访问计划。
These different ways are known as access paths or access plans.
在开始本教程之前,您应该熟悉SQL访问计划的概念。
Before beginning this tutorial, you should be familiar with the concept of an SQL access plan.
图3描绘了我们在本文前面多次使用的查询的访问计划。
Figure 3 depicts the access plan for the very query that we used before extensively in this article.
应用推荐