At this step, you need to use the tools discussed above to get statistics on the query: its response time, its detailed execution plan, and costs for later in-depth analysis.
在这一步中,需要使用上面讨论的工具来获取该查询的统计数据:其响应时间、详细的执行计划和成本,以便稍后进行深入分析。
You have learned how to analyze and tune the problem query from the perspective of statistics, predicates, and indexes.
您已经了解如何从统计数据、谓词和索引这几方面来分析和调优问题查询。
If the remote view contains a complex query, using table-level statistics such as the cardinality for the nickname over the view can be misleading.
如果远程视图包含一个复杂的查询,那么使用表级统计信息(例如视图昵称的基数)可能使人产生误解。
Cardinality estimation is a process by which the optimizer USES statistics to determine the size of partial query results after predicates are applied or aggregation is performed.
基数估计是这样一种过程:在应用了谓词或执行了聚集之后,优化器使用统计信息确定部分查询结果的大小。
The optimizer USES data distribution information generated by UPDATE STATISTICS to calculate selectivity for the filters in the query.
优化器使用UPDATESTATISTICS所生成的数据分布信息来计算查询中筛选器的选择性。
Figure 3 shows the basic implementation architecture of advanced query statistics.
图3显示的是高级查询统计的基本实现架构。
You should always include this in a query comparing configuration values to statistics values.
在比较配置值与统计值的查询中始终都应包含该谓词。
There are two steps or functions involved in working with advanced query statistics.
使用高级查询统计有两个步骤,或者说是两个功能。
The RUNSTATS utility updates statistics in the system catalog tables to help with the query optimization process.
RUNSTATS实用程序用于更新系统目录表中的统计信息,以帮助查询优化过程。
Advanced query statistics has its own graphical user interface for visually displaying the information.
高级查询统计有自己的图形用户接口,用于可视化显示信息。
The first step is to configure this feature using the advanced query statistics user interface menu.
第一步是使用高级查询统计用户接口菜单配置该新特性。
In addition, it discusses the role of the optimizer, including the OPTCOMPIND parameter, query directives, and internal statistics.
此外,还将讨论优化器的角色,其中包括OPTCOMPIND参数、查询命令和内部统计数据。
Instead, the optimizer gathers up-to-date statistics on every database table referenced in a query.
相反,优化器将对查询中引用的每个数据库表收集最新的统计数据。
You can see that DB2 has to evaluate less rows to execute the query when distribution statistics are available.
您可以看到,有分布统计信息的情况下,DB 2执行查询时需要计算的行数更少。
Figure 1 displays the advanced query statistics configuration screen.
图1显示的是高级查询统计配置界面。
The query access plan produced after collecting these statistics is the same as the final plan in Example 3.
收集这些统计信息后生成的查询访问计划与示例3中的最后的计划相同。
The implementation of advanced query statistics is based on the query log database technology.
高级查询统计的实现是基于查询日志数据库技术。
Before automatic statistics profiling is activated, a query feedback warehouse must be created by running the SYSINSTALLOBJECTS stored procedure.
在触发自动统计信息配置之前,必须通过运行sysinstallobjects存储过程创建查询反馈仓库。
Annotate the problem query with relevant statistics to better understand what the DB2 optimizer is using for its estimations.
使用相关统计数据来注释有问题的查询,这样可以更好地理解DB 2使用哪些内容来进行评估。
Accurate index information and statistics are fundamental to cost-based decisions in the query optimizer.
准确的索引信息和统计信息是查询优化器中基于成本的决策的基础。
In some cases, gathering the statistics might take longer than executing the query.
在某些情况下,收集统计信息需要的时间可能比执行查询的时间更长。
In this section, let's walk through the steps to set up advanced query statistics.
本小节中,我们体验一下安装高级查询统计的步骤。
The optimizer calculates its cardinality estimate — that is, the estimated number of rows returned by the query — based on the statistics available.
优化器根据可用的统计信息计算基数的估计值,即预计查询返回的行数。
For statistical view, the ENABLE query optimization clause will cause the view, and its associated statistics to be used to improve the query optimization.
对于统计视图,ENABLEQUERYoptimization子句将导致该视图以及与之相关联的统计信息被用于改进查询优化。
The optimizer relies on statistics to properly cost alternative query execution plans (QEPs) and choose the most optimal plan.
优化器是依靠统计信息来计算可选查询执行计划(QEP)的开销,同时选择出最优的计划。
One way to validate the suspicious performance bottleneck is by looking into the runtime statistics of the query, which can be obtained by turn on the performance trace on IFCID 318.
验证可疑性能瓶颈的一个方法是查看查询的运行时统计数据,这可以通过打开IFCID 318上的性能跟踪获得。
As you can see, query statistics in Version 8.5 is limited when compared to the flexibility of the configuration and the rich charts available with advanced query statistice in Version 9.1.
如您所见,与 9.1版本中的配置和丰富图表的灵活性相比,8.5 版本中查询统计数据还是相当有限的。
Collect statistics on your original SQL query.
收集关于原始sql查询的统计数据。
Therefore, UPDATE STATISTICS cannot be compared to executing the query itself unless it is run in the high mode.
因此,除非以high模式运行,否则UPDATESTATISTICS与执行查询本身是不能相提并论的。
Implementation architecture of advanced query statistics.
高级查询统计的实现架构。
应用推荐