- 最后登录
- 2013-4-12
- 在线时间
- 2 小时
- 威望
- 0
- 金钱
- 15
- 注册时间
- 2011-11-1
- 阅读权限
- 10
- 帖子
- 11
- 精华
- 0
- 积分
- 0
- UID
- 80
|
1#
发表于 2012-12-13 19:49:50
|
查看: 5468 |
回复: 3
google了一下,找到了Steve Adams 的解释:
These are two different approaches to how Oracle can use an index for predicates such as
where indexed_column in (:1, :2, :3)
To use the index, rather than doing a full table scan, the CONCATENATION approach is to transform the query into a UNION-ALL of
several queries (in this case 3) and those queries each use the index to lookup just one value. The disadvantage is that there
is a distinct row source for each inlist value. Thus this approach uses frame memory in proportion with the number of values.
It can also constrain some parts of the execution plan to be repeated in each of the concatenated queries.
The inlist iterator does the same in a single row source. Therefore it is better in every respect.
http://www.ixora.com.au/q+a/0009/21225019.htm
似乎inlist iterator 只需要扫描一遍就可以完成,而CONCATENATION 需要转换成多个UNION ALL
但似乎Tom说这两个东西是一样的,见Followup August 7, 2008 - 12pm Central time zone:
forget the "inlist" stuff for a moment, it won't matter - concatenate + many range scans = inlist iterator - they are the same (inlist interator is just a more "compact" way of saying it - else - they are the SAME when executed, each will hit the index N times for a range scan)
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:8906695863428
不是很明白,请拍砖
|
|