explain plan for SELECT A.*
FROM (SELECT /*+ use_hash(cd cv)*/ CD.*,
nvl(CV.SUM_CI_BALANCE, 0) as SUM_CI_BALANCE,
nvl(CV.SUM_LN_BALANCE, 0) as SUM_LN_BALANCE
FROM OCRM_F_CI_CUST_DESC CD
left join (
select cust_id,
FR_ID,
sum(CI_BALANCE) as sum_CI_BALANCE,
sum(LN_BALANCE) as sum_LN_BALANCE
from OCRM_F_CI_CUST_VIEW
where 1 = 1
and FR_ID = '15601'
and MGR_ID = '00001'
group by cust_id, FR_ID
union
select cust_id,
FR_ID,
sum(CI_BALANCE) as sum_CI_BALANCE,
sum(LN_BALANCE) as sum_LN_BALANCE
from OCRM_F_CI_CUST_VIEW
hash join 驱动表和被驱动表不一定是全表扫描
最新推荐文章于 2022-09-27 11:28:11 发布