有人可以帮助我优化此查询吗?
这需要花很多时间才能完成TOAD:
select dim.comply_hotlist_sid --,DIM.HOTLISTID,dim.tin1,dim.*
from EDW_WDS.D_T2_COMPLY_HOT_LIST dim
where dim.COMPLY_HOTLIST_CURRENT_FLG = 'Y'
and DIM.HOTLISTID in
(
select distinct CMP.HOTLISTID
from MKT.D_CUSTOMER tp
join DW_ods.N_COMPLY_HOT_LIST cmp
on CMP.TIN1 = TP.SSN_TAX_ID
join DW_DW.D_LOAN_VERSION_2 ln
on LN.LOAN_ACCT_NBR = TP.LOAN_ACCT_NBR
join DW_DW.AGG_LOAN_SS_MONTHLY mnt
on MNT.LOAN_SID= LN.LOAN_SID
where CMP.STATUSCODE = 'A'
and CMP.ISLASTLOAD = 'Y'
and TP.LOAN_ACCT_NBR is not null
and TP.SSN_TAX_ID <> ' '
and TP.SSN_TAX_ID is not null )