当前位置: 代码迷 >> Oracle开发 >> left join 能极大的降低效率吗
  详细解决方案

left join 能极大的降低效率吗

热度:66   发布时间:2016-04-24 06:38:28.0
left join 会极大的降低效率吗?
现在有一条查询语句用了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.*
  相关解决方案