现在有一条查询语句用了6个left join,查询时速度时快时慢。具体表现为,第一次查询耗时10几秒,随后再查询只要2秒左右,再过一段时间去查询耗时又增加到10几秒。表PamEntry,pamelig,pameligresquest,pamupload数据为7W左右,其他表为2K一下。
由于数据库在客户那里,我们开发人员只有修改表的权限,也无法查看v$相关的表,只能在PL/SQL 里面看一下查询计划,请大家帮忙分析一下这条查询语句是不是有很大的性能问题?如果把left join的表合并到一张表里面,速度是不是可以提升很多?谢谢了!
select *
from (select tmp.*, rownum as rum_
from (select t.*,
d.eligbegindate,
d.eligenddate,
e.subfirstname subresfirstname,
e.sublastname subreslastname,
e.subssn,
e.subdob,
e.subemployer,
e.subaddress1,
e.subaddress2,
e.subphone,
e.subaltphone,
b.clientName,
c.payerfullid as pamPayerFullId,
c.payername as emdeonPayerName,
CASE
WHEN t.status = 'C' THEN
'Closed'
WHEN t.status = 'W' THEN
'WIP'
WHEN t.status = 'P' THEN
'Processed'
WHEN t.status = 'EI' THEN
'EligIncomplete'
WHEN t.status = 'PI' THEN
'XPRE'
WHEN t.status = 'I' THEN
'EligIncomplete'
WHEN t.status = 'PE' THEN
'PE'
END as status2,
f.uploadtime as uploadtime,
g.definition
from (select t.*