- 最后登录
- 2015-3-26
- 在线时间
- 148 小时
- 威望
- 84
- 金钱
- 1061
- 注册时间
- 2011-11-26
- 阅读权限
- 50
- 帖子
- 128
- 精华
- 0
- 积分
- 84
- UID
- 96
|
5#
发表于 2013-1-14 13:27:20
我觉得之所以走hash join 是因为两张表 都是1W条左右的数据。数据量差不多。如果是一张大表然后Join一张小表估计就要 nest loops了。
例如:select b.account,
b.en_code,
b.chinese_name,
b.account_type,
b.currence_code,
case
when s.account_status = '11' then
b.open_date
else
b.importdate
end,
b.file_number,
b.instcode,
'1',
-- b.auditdate,
b.importdate,
b.businessid,
-- b.auditname,
-- b.modifyuser,
b.iscommit,
'A',
'',
b.branch_code,
b.branch_name,
s.account_status,
b.amtype,
b.account_cata,
b.limit_type,
b.remark,
b.is_handiwork,
b.account_limit
from tmp_t_base_account b
,tmp_account_status s
where b.account || b.instcode || b.currence_code = s.account_num
and s.account_status in ('11', '12')
ID PID Estim
Card Actual
Rows Row Source Operation BG
Consistent
Read Mode
(cr) OS
Buffer
Gets
(pr) OS
Write
Calls
(pw) Time
(secs) Obj Cost Estim
Size
(bytes)
1: 0 101 751 NESTED LOOPS 847142964 699 0 1193.496 0 108 20705
2: 1 128 414043 TABLE ACCESS FULL TMP_T_BASE_ACCOUNT 10833 692 0 4.077 17081 3 22656
3: 1 1 751 TABLE ACCESS FULL TMP_ACCOUNT_STATUS 847132131 7 0 2374.070 17056 1 28
|
|