【发布时间】:2013-01-03 09:53:58
【问题描述】:
您好,我有一个非常大的查询,包括两个主表和 15 个子表。
ie, Main table say table_a join with some other 10 tables.
and another main table sat table_b join with some other 5 tables.
Table_a contains - 314988 rows and
Table_b contains - 710989 rows.
当我们加入时,我可以找到许多 NL 加入和 HS 加入。
有趣的事实是所有HSjoin cost very less and NL join cost 非常非常高。
那么是否可以将连接从 NL 转换为 HS Join。
注意:它的所有索引.. 没有 TBSCAN 一切都是 IXSCAN。
【问题讨论】:
-
您的默认优化级别是多少?您的所有表和索引的统计信息都是最新的吗?
标签: sql db2 query-optimization