oracle三个版本中对哈希外连接的优化方式

作者:奶妈来了 | 分类: 大话技术 | 标签: | 日期:2009-02-19

哈希外连接在oracle中的处理方式 , 通常我们认为都是 主表作为 构建哈希table的表, 而子表则作为 匹配的表.

今天看了下9i, 10g, 11g的<<Performance Tuning Guide>>, 发现并不是这样的. 三个版本中的描述分别如下:

9i中对hash outer join的描述

Like an outer join,the order of tables is not determined by the cost, but by the join condition.

The outer table (with preserved rows) is used to build the hash table,

and the inner table is used to probe the hash table.

10g中对hash outer join的描述

The order of tables is determined by the cost.

The outer table, including preserved rows, may be used to build the hash table, or it may be used to probe one.

11g中对hash outer join的描述

The order of tables is determined by the cost.

The outer table, including preserved rows, may be used to build the hash table, or it may be used to probe one.

可见, 从10g开始 , oracle就已经允许外连接的子表作为构建哈希table的表, 而到底选用主表还是子表作为哈希外连接时构建哈希table的表, 则是由cost决定的.

2人发表了评论  ↓发表评论↓
  • 主表,子表?
    这个命名很奇怪,没怎么听过这种叫法的 :)

    sky @ February 20, 2009 |

  • 10g里可以用外连接的表做驱动表,执行计划里出现hash join right join outer

    棉花糖ONE @ February 20, 2009 |

表情:<( ̄︶ ̄)> | (⊙ˍ⊙) | >﹏< | b( ̄▽ ̄)d | (─.─||) | (^_-)

[ Ctrl+Enter提交 ]

阿里巴巴DBA出品