oracle join速度慢,子查询参与join,性能很慢,如何解决?

select a.svoucherno,a.setid,a.year,a.totalmoney,a.voudate,

a.eid,e.name ename,mid,m.name mname,a.bid,b.name bname,

a.iid,a.pid,p.name pname

from (select v.svoucherno,v.setid,v.year,v.totaldeb totalmoney,

v.year||'-'||substr('00'||v.month,length('00'||v.month)-1,2)||'-'||substr('00'||v.day,length('00'||v.day)-1,2) voudate,

(select substr(aid,4,length(aid)-2) from assistantvoudetail avd

where instr(aid,'003')=1

and v.svoucherno=avd.svoucherno and line=1) eid,

(select substr(aid,4,length(aid)-2) from assistantvoudetail avd

where instr(aid,'004')=1

and v.svoucherno=avd.svoucherno and line=1) mid,

(select substr(aid,4,length(aid)-2) from assistantvoudetail avd

where instr(aid,'005')=1

and v.svoucherno=avd.svoucherno and line=1) bid,

你可能感兴趣的:(oracle,join速度慢)