select a.*,b.*,to_char(a.launch_time,'yyyy-MM-dd hh24:mi:ss') l_time,e.ename,ed.dictname,d.pathname servicecatalogname,
b.applicant,b.applicant_com,t.customerorganname,(select tmp.uname from (select row_number()
over(partition by m.instance_id order by m.task_log_id) gid,m.user_name uname,m.processinstid from bpm_rtm_log_task m where
m.process_id= 'cn.net.sinodata.sdbomc.itsm.workflow.genericservice.genericservice') tmp
where tmp.gid=2 and a.processinstid = tmp.processinstid)
from bpm_rtm_process_instance a,
bpm_biz_itsm_genericservice b,
itsm_dict_servicecatalog d,
itsm_dict_gs_emergency e,
eos_dict_entry ed,
(select t.customeruserid,
t.customerid,
t.customerusername,
t.customeruserorgan,
t.customeruserphone2,
t.customerusermail,
t.customerusermsn,
t.customeruserqq,
t.createname,
t.createtime,
t.lastupdatename,
t.lastupdatetime,
t.helpdeskapplyrole,
t.headername,
t.headerid,
b.customerorganname
from itsm_dict_customer_user t, itsm_dict_customer_organ b
where t.customeruserorgan = b.customerorganid(+)) t
where a.processinstid = b.processinstid_
and ed.dicttypeid = 'BPM_CFG_INST_STATUS'
and a.instance_status = ed.dictid(+)
and b.servicecatalog = d.id(+)
and b.urgency_degree = e.id(+)
and b.applicant_id = t.customeruserid(+)
and b.applicant_com_id = t.customerid(+)
and b.data_type_ = 'new'
order by a.launch_time desc
------解决方案--------------------
看了你的执行计划之后。按照我上面说的两点进行优化 应该没问题了。
主要的都是进行的全表扫描。需要索引支持。就是在所有的左连接的字段上都建立索引,所有的左连接的表
------解决方案--------------------
16楼牛X啊嘎嘎嘎嘎