- 最后登录
- 2015-5-21
- 在线时间
- 100 小时
- 威望
- 0
- 金钱
- 345
- 注册时间
- 2012-12-19
- 阅读权限
- 10
- 帖子
- 99
- 精华
- 0
- 积分
- 0
- UID
- 824
|
1#
发表于 2013-1-11 09:09:36
|
查看: 3444 |
回复: 3
select * from v$version;
1 Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
2 PL/SQL Release 10.2.0.3.0 - Production
3 CORE 10.2.0.3.0 Production
4 TNS for IBM/AIX RISC System/6000: Version 10.2.0.3.0 - Productio
5 NLSRTL Version 10.2.0.3.0 - Production
原语句:
select mmt.organization_id, mmt.subinventory_code, mmt.attribute10, mmt.transaction_date,nvl(mtln.transaction_quantity,mmt.primary_quantity) transaction_quantity
from mtl_material_transactions mmt, mtl_transaction_lot_numbers mtln
where mmt.transaction_id = mtln.transaction_id(+)
and mmt.organization_id = mtln.organization_id(+);
执行计划:
1
2 --------------------------------------------------------------------------------------------------
3 | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)|
4 --------------------------------------------------------------------------------------------------
5 | 0 | SELECT STATEMENT | | 4779K| 355M| | 99767 (2)|
6 |* 1 | HASH JOIN RIGHT OUTER| | 4779K| 355M| 63M| 99767 (2)|
7 | 2 | TABLE ACCESS FULL | MTL_TRANSACTION_LOT_NUMBERS | 1470K| 46M| | 12978 (3)|
8 | 3 | TABLE ACCESS FULL | MTL_MATERIAL_TRANSACTIONS | 4779K| 205M| | 70656 (2)|
9 --------------------------------------------------------------------------------------------------
10
11 Predicate Information (identified by operation id):
12 ---------------------------------------------------
13
14 1 - access("MMT"."TRANSACTION_ID"="MTLN"."TRANSACTION_ID"(+) AND
15 "MMT"."ORGANIZATION_ID"="MTLN"."ORGANIZATION_ID"(+))
16
17 Note
18 -----
19 - 'PLAN_TABLE' is old version
如果语句中必须有类似mmt.transaction_id = mtln.transaction_id(+)这类语句能不能避免对表的全扫面?我想到的通过修改访问路径或者添加索引好像不能解决,有没有高手能指点一下 |
|