通过内部统计数据,我指的是系统目录中的统计数据,优化器可以确定最低成本的查询执行计划。
By internal statistics, I mean the statistics in the system catalogs that the optimizer USES to determine the lowest-cost query execution plan.
优化器凭借精确的基数估计值来准确计算出每一个待定查询访问计划的成本。
The optimizer is dependent on accurate cardinality estimates to properly compute the cost of each query access plan considered.
优化器凭借精确的基数估计值来准确计算出每一个待定查询访问计划的成本。
The optimizer depends on accurate cardinality estimates to properly compute the cost of each query access plan considered.
对于优化器不能选择最佳查询执行计划的例外情况,DB 2已经增加了诸如selectivity子句和优化指南之类的特性。
For the exceptional situations where the optimizer cannot choose an optimal query execution plan, DB2 has added features such as the SELECTIVITY clause and optimization guidelines.
因此,如果统计数据不准确或者过期,或者冲突,优化器会对查询计划中各步骤的成本评估不准确,从而导致糟糕的性能。
Consequently, if the statistics are inaccurate, outdated, or conflicting, the optimizer will create inaccurate estimates for the costs of the steps in a query plan, leading to poor performance.
生成访问计划,查看优化器对该查询返回的总基数(行数)的估计值。
Generate the access plan and see what the optimizer estimates the total cardinality (Number of rows) returned by the query will be.
您可以利用DB2 9.5 中的多列统计信息的扩展用途来为优化器提供更多的信息,从而使优化器更好地估计基数,选择最佳的查询访问计划。
You can leverage the extended use of multi-column statistics in DB2 9.5 to provide the optimizer more information to better estimate the cardinality in order to choose an optimal query access plan.
优化器是依靠统计信息来计算可选查询执行计划(QEP)的开销,同时选择出最优的计划。
The optimizer relies on statistics to properly cost alternative query execution plans (QEPs) and choose the most optimal plan.
当优化器创建查询计划时,它将使用下列系统目录信息。
The optimizer USES the following system catalog information as it creates a query plan.
优化器会选择类似如下所示的查询访问计划。
A query access plan similar to the following is chosen by the optimizer.
检查db 2 exfmt或VisualExplain输出中经过优化的SQL,因为这是关系数据源下推分析和查询优化器确定计划的基础。
Inspect the optimized SQL in the db2exfmt or Visual Explain output, as this is the basis for the planning decision of the relational data source push-down analysis and the query optimizer.
EXPLAIN工具可以用于查看优化器选择的查询访问计划,要使用该工具需要有explain表。
The EXPLAIN tool, which requires the existence of the EXPLAIN tables, can be used to view the query access plan chosen by the optimizer. To create the EXPLAIN tables, execute.
有了这个特性,查询优化器可以在决定访问计划时立即考虑索引。
With this feature, the query optimizer can immediately consider the index when determining an access plan.
当评估查询执行计划时,优化器计算并比较每种连接方法的成本,然后选择要使用的最佳方法。
The optimizer calculates and compares the costs of each join method and selects the best one to use when evaluating query execution plans.
优化器将选择该查询计划,因为其执行的估算成本是所有被估计划中最低的。
The optimizer chose this query plan because the estimated cost for its execution was the lowest among all the evaluated plans.
一旦理解了自己的选择,就可以通过调整OPTCOMPIND参数,或者通过添加查询指示或索引,来影响优化器,从而选择最佳的查询执行计划。
Once you understand your options, you can influence the optimizer to select the best query execution plan, either by adjusting the OPTCOMPIND parameter or by adding query directives or indexes.
查询优化器可能得出一个不同的查询执行计划,这个计划可以专门为最快地获取前'N '行,而不是所有结果行提供良好的性能。
The query optimizer might come up with a different query execution plan tailored to provide good performance for fast retrieval of first 'n' rows rather than all the result rows.
在select语句中使用视图,可以限制表的连接顺序,同时也限制查询优化器在考虑访问计划时的选择。
Using views in a SELECT statement can restrict the join order of the tables and limit the query optimizer's choices when considering access plans.
分析查询访问计划,从而可以切实看到优化器对访问数据作出的选择。
Analyze the query access plan to visualize the choices the optimizer makes in accessing the data.
为了实现星型连接查询的最佳执行计划,优化器在适当的时候会考虑星型连接优化,并根据成本因素来决定星型连接计划。
The optimizer considers star join optimization when appropriate and decides on star join plan based on cost considerations in order to come up with best execution plan for a star join query.
当DB 2优化器为一个查询形成查询访问计划时,它将工作划分到多个数据库分区上,这些数据库分区是并行工作的。
When the DB2 optimizer forms a query access plan for a query, it divides the work among the database partitions which work in parallel.
当一个查询引用一个函数模板时,查询优化器尝试生成一个灵活的计划,允许在远程数据源上计算这个函数引用。
When a query references a function template, the query optimizer tries to generate a feasible plan that allows this function reference to be evaluated on the remote data source.
统计视图和REOPT都使优化器可以计算出更精确的基数估计,而后选择一个最佳查询执行计划。
Both statistical views and REOPT allow the optimizer to compute a more accurate cardinality estimate and consequently choose an optimal query execution plan.
在为查询生成计划的过程中,查询优化器与非关系包装器通信。
During plan generation for the query, the query optimizer communicates with the non-relational wrapper.
如果优化器能预知查询结果(或部分查询结果),那么该信息对于帮助确定更精确的访问计划将非常有用。
If the optimizer can peek into the query result (or partial query results), and armed with that foresight, then the information can be extremely useful to help determine a more accurate access plan.
SQL解释工具提供查询优化器为 SQL语句所选择的访问计划的有关详细信息。
The SQL explain facility provides detailed information about the access plan that the query optimizer chooses for an SQL statement.
更新统计数据是最重要的管理任务之一,它确保优化器选用最佳的查询执行计划。
Updating statistics is one of the most important administrative tasks that ensure the optimizer picks optimum execution plans for your queries.
为了确保优化器选择最佳的查询计划,使内部统计数据保持为最新并且最准确的十分重要。
To ensure that the optimizer selects the best query plan, it is important to keep internal statistics current and accurate.
当发出下面的查询时,查询优化器将检测到该查询可以用一个MQT来回答,因而可能会选择访问该MQT的一个访问计划。
When the following query is issued, the query optimizer will detect that the query can be answered using an MQT, and may choose an access plan that accesses the MQT.
然而,您可能仍然希望优化器基于用户传递给查询的值来查找最佳的存取计划。
However, you would still like the optimizer to find the best access plan based on the values that users have passed into the query.
应用推荐