SQE is the strategic query engine on DB2 for I, with better performance, scaling and tooling such as the SQL Plan Cache.
SQE是DB 2fori上的战略性查询引擎,具有更好的性能、可伸缩性和工具,例如SQL PlanCache。
The true solution to this problem is to improve the access plan for problematic SQL statements by adding the correct indexes.
这个问题的正确解决方案是通过添加正确的索引改进有问题的sql语句的存取方案。
If there are no growing cost SQL queries in the snapshot, analyze the access plan to see which can be amended based on the accumulated data.
如果在快照中没有成本增加的SQL查询,可以分析访问计划,以查看可以根据累积的数据进行哪些修改。
The identified problematic SQL statements should be explained to show the access plan for any needed, specific tuning.
应当解释已发现的有问题的sql语句,以便为特定的调优需求显示访问计划。
Important: it is important that, for performance and stability reasons, your SQL server has a Database Maintenance plan configured.
重点:由于性能和稳定性原因,重要的是,您的SQL服务器配置了一个数据库维护计划。
As we've discussed in this article, the DB2 optimizer may choose a sub-optimal access plan when there are host variables or parameter markers in the SQL statement.
正如我们在本文讨论的,如果sql语句中存在主机变量或参数标记,那么DB 2优化器可能会选择一个次优化的存取计划。
Access plan describes the access path that the DB2 optimizer has chosen for accessing data for an SQL statement.
访问计划描述访问路径,这些路径是DB 2优化器为sql语句访问数据而选择的。
The example below introduces the access plan basics by analyzing the bad SQL statement we captured in the previous section.
下面的示例通过分析我们在前面小节中所捕获的糟糕查询,介绍访问计划的基础知识。
As the previous section described, parameter marker usage in SQL statements fosters access plan reuse.
如上节所述,sql语句中的参数标记使用可促进访问计划重用。
For further flexibility, dynamic SQL allows for changing this option within a plan or package by the SET CURRENT DEGREE statement, which controls the value in a special register.
为获得更大的灵活性,动态SQL允许通过SETCURRENTdegree语句在一个计划或包中更改这个选项,该语句可以控制专用寄存器中的值。
The reason for using binding parameters is to ask the database to parse your SQL once and reuse the generated execution plan for subsequent repeat requests, which saves both CPU time and memory.
使用绑定参数的原因是让数据库一次解析sql,对后续的重复请求复用生成好的执行计划,这样做节省了CPU时间和内存。
Remember that DB2 can only reuse an access plan if SQL statement texts completely match.
还记得吗,DB2仅在SQL语句文本完全匹配时才能重用访问计划。
The access plan for a given SQL statement is generated at bind time.
一个特定sql语句的存取计划是在绑定时生成的。
If you plan to create the solution on your system it would be helpful to have a basic knowledge of database systems, DB2, and SQL statements.
如果您计划在自己的系统上创建解决方案,那么最好了解数据库系统、DB2和sql语句的基本知识。
So if an access plan is reused, a database server requires less CPU resources to execute the corresponding SQL statement repeatedly.
因此,如果一个访问计划被重用,则数据库服务器重复执行相应sql语句所需的CPU资源将减少。
If the cost estimatd does not correctly describe the real cost during SQL execution, the access plan picked by the optimizer may not be optimal.
如果评估得到的开销不能够正确反映SQL执行中的实际开销,那么优化器所选择的存取计划可能不是最优的。
The SQL explain facility provides detailed information about the access plan that the query optimizer chooses for an SQL statement.
SQL解释工具提供查询优化器为 SQL语句所选择的访问计划的有关详细信息。
If some of the top SQL statements are considered unexpectedly expensive, further action is required to analyze the SQL access plan to see if anything can be improved.
如果其中一些最优sql语句被认为是异常昂贵的,下一步将需要分析SQL访问计划,看看是否还可以改进。
This file is cumulative, in other words, if you have multiple SQL queries after SET EXPLAIN on statement, each query execution plan and its costs would be appended to this file until it is removed.
该文件是累积的,换言之,如果SETEXPLAINON语句之后有多个SQL查询,每个查询的执行计划及其成本都会被追加到文件中,直到将之删除。
Always use literals if the optimal access plan for the SQL statement varies according to the literals in the filter conditions.
如果sql语句的最优访问计划根据过滤条件中的文本变化,则应总是使用文本。
Before beginning this tutorial, you should be familiar with the concept of an SQL access plan.
在开始本教程之前,您应该熟悉SQL访问计划的概念。
Bind is the process that saves the access plan associated with a SQL statement into a DB2 SQL package.
绑定过程将与一个sql语句相关联的访问计划保存到一个DB 2 sql包中。
From the performance perspective, dynamic SQL statement can be prepared once and executed multiple times, reusing the same database access plan.
从性能的角度来看,动态sql语句只需要准备一次就可以执行多次,可以重用相同的数据库访问计划。
To enable access plan reuse, rewrite the SQL statement using a parameter marker, as shown in Listing 3.
要实现访问计划重用,使用一个参数标记重写SQL语句,如 清单3 所示。
Rebind applications that use static SQL after using RUNSTATS so that the query optimizer can choose the best access plan given the new statistics.
在使用RUNSTATS之后需要重新绑定使用静态SQL的应用程序,这样查询优化器就可以选择新统计信息所给出的最佳存取方案。
It can also capture queries from SQL cache and produce the explain plan.
它还可以从SQL缓存捕获查询并生成解释计划。
For SELECT queries, the text of the remote SQL statement can be found in the details associated with the SHIP operator in the query execution plan.
对于SELECT查询,远程sql语句中的文本可以在查询执行计划中与SHIP操作符相关的细节中找到。
A good access plan is key for the fast execution of an SQL statement.
好的访问计划对于sql语句的快速执行至关重要。
Briefly, an access plan is the set of steps that DB2 USES to execute a SQL statement and access data.
简单地说,访问计划是DB2用来执行sql语句和访问数据的一组步骤。
Use SQL directives to effect the query plan.
使用SQL指令实现查询计划。
应用推荐