The following guideline was created to influence the optimizer to consider I11 index, and substantially improved the time to refresh the MQT mqt1 by more than 2X.
但是,可以通过创建下面的指南来影响优化器,使之考虑I11索引,从而将 MQT mqt1 的刷新速度提高两倍以上。
步骤1:创建MQT。
Step 1: You could define an MQT as follows
步骤1:您可以像下面这样定义一个MQT
Populating a user-maintained MQT with data.
用数据填充用户维护的mqt。
Populating a system-maintained MQT with data.
用数据填充系统维护的mqt。
Make sure the MQT is enabled for optimization.
确保为优化启用了MQT。
An MQT can also make use of partitioning features.
MQT也可以使用分区特性。
Hints and tips on why a query is not using an MQT.
关于查询为什么不使用MQT的提示和技巧?
You can think of an MQT as a kind of materialized view.
您可以将MQT看作一种物化的视图。
For example, an MQT can be partitioned using MDC or TP.
例如,可以使用MDC或TP对MQT分区。
How is the decision made to use an MQT to answer a query?
如何作出在查询中使用MQT的决策?
The data is loaded into the MQT using the "load command".
使用“Load命令”将数据加载到MQT中。
Step 10: Find out whether MQT is being used to answer a query.
步骤10:找出是否使用MQT来回答查询。
DB2 can automatically rewrite a query to take advantage of an MQT.
DB 2可以自动地重写查询以使用MQT。
Also assume that the MQT aggregate_sales exists as described before.
还与前面描述的一样,假设MQT aggregate_sales已经存在。
An MQT is a table whose definition is based on the result of a query.
MQT是基于一个查询的结果而定义的表。
Computations common to multiple queries can be represented using an MQT.
对多个查询公共的计算可以使用MQT来表示。
Note that the query has been rewritten to access the aggregate_sales MQT.
注意,该查询被重写来访问aggregate_salesMQT。
A user does not need to change the query in order to make use of the MQT.
为了使用MQT,用户不必要更改查询。
One needs to carefully determine the clauses to use while creating an MQT.
创建 MQT时需要仔细地确定要使用的子句。
Step 3: At this point you may want to consider defining indexes on the MQT.
步骤3:这时,您可能需要考虑在MQT上定义索引。
An MQT can be indexed to provide an even greater boost to query performance.
可以在MQT上定义索引,这会进一步提高查询性能。
For example, an MQT can be created on one or more tables that USES MDC and TP.
例如,可以在一个或多个使用MDC和TP的表上创建MQT。
Listing 2 shows an example of creating a REFRESH DEFERRED user-maintained MQT.
清单2展示了一个创建REFRESHDEFERRED类型的用户维护的MQT的例子。
Listing 1 shows an example of creating a REFRESH IMMEDIATE system-maintained MQT.
清单1展示了一个创建REFRESHimmediate类型的系统维护的MQT的例子。
As the data for the base table (s) changes, the MQT needs to be updated accordingly.
当基本表中的数据发生改变时,需要相应地更新MQT。
If your query is not using an MQT and you believe it should be, check the following.
如果您的查询未使用MQT,而您认为它应该使用,那么请检查。
If the MQT happens to have a key, unique indexes should be created to reflect the fact.
如果MQT具有一个键,那么应该创建惟一的索引以反映这一事实。
The MQT refresh is triggered when the table tab2 involved in its definition is populated.
当为MQT定义中涉及的表tab2填充数据时,就会触发对MQT的刷新。
MQT recommendations (first new ones, then existing ones to keep, and finally unused ones).
MQT建议(首先是新的MQT,然后是要保留的已有的MQT,最后是未使用的MQT)。
应用推荐