----办理中
select distinct(si.id),lettertype,lettersrc,zb.nibandate,titlename ,zb.loginname,nibandate,zb.ext2,zb.limitdate,
to_date(zb.limitdate,'yyyy-mm-dd')-to_date('2011-05-25','yyyy-mm-dd')
from szrx.slj_info si,szrx.slj_zhuanban zb
where si.id=zb.letterid and letterstate=1
and zbstate=1 and zbclass=0 and dbloginname='9987' order by zb.nibandate desc
----已反馈
select sh.unitid,sh.handledate,si.id,lettertype,lettersrc,applytime,'titlename' ,'fileinfo'
from szrx.slj_handle sh,szrx.slj_info si where si.id=sh.letterid and si.dbloginname='9987' and length(sh.unitid)=4 and si.letterstate=2 and sh.handletype=0
and sh.ext1=0
order by sh.handledate desc
哪位大虾看下这两条语句哪个执行效率快,慢的该如何优化
我执行后的结果是 办理中的几十毫秒,结果是241条,已反馈需要4秒多,结果是40条
------解决方案--------------------
想想应该怎么执行最快
然后看看执行计划是否符合你的想法