Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Query on 11gR2 much slower than on 10gR2

UW (Germany)Aug 8 2012 — edited Aug 14 2012
I'm just working to replace an old server with a 10gR2 Oracle database with a new much bigger and faster machine and Oracle 11gR2 (11.2.0.3). Most of my queries run 10 or 100 times faster now but there is one intractable query, that needs only a few seconds on the old server and on the new machine I killed the session after nearly four hours of waiting without a result.

The query is indeed complex and uses several nested views and things like "connect by" and "regexp". Some tricks, that I learned in this forum (see forums.oracle.com/forums/thread.jspa?messageID=3911361), are used to multiply factors from the different hierarchical levels. Is there a general change in the database version that makes it impossible to use the query below?

In my research on this problem I have learned, that the function "sys_connect_by_path" is not supported by Oracle. Is it possible that a complex query which uses "sys_connect_by_path" gets stuck in an infinite loop in 11gR2?

I also read, that "sys_connect_by_path" should be replaced by the new function "listagg" in 11gR2. But I found no examples and I have no idea, how "listagg" can be used in a hierarchical query like
select 
 ename, 
 sys_connect_by_path(ename, '>') hierarchy
from scott.emp
connect by prior empno = mgr
start with ename = 'KING'
order by 2;
Or is it possible to speed up the following query on the new server significantly by using optimizer hints or by changing the structure of the query or maybe with any additional indexes.
This is my query (I only renamed the tables and columns to hide traces to the software):
with
z0 as
( select
    p3.ii,
    v1.vi,
    p3.re re,
    p4.re vr,
    to_char(p4.bn) bn,
    p4.at,
    to_char(p3.bn) rba,
    p3.at rtk,
    to_char(round(v1.cf / p4.fa, 7)) fa,
    to_char(v1.cf,'0.999999')||'/'||
    to_char(p4.fa,'0.999999') sf,
    'V' pi,
    to_char(p4.bn)||'('||p4.at||')' bk
  from
       rv.pd p3
  join rv.pv v1 on v1.pi = p3.ii
  join rv.pd p4 on p4.ii = v1.vi
  union
  select
    p5.ii,
    g1.vi,
    p5.re,
    p6.re,
    to_char(p6.bn) bn,
    p6.at,
    to_char(p5.bn) rba,
    p5.at rtk,
    to_char(round(g1.om / p6.tt, 7)),
    to_char(g1.om,'99990.999')||'/'||
    to_char(p6.tt,'99990.999'),
    'G' pi,
    to_char(p6.bn)||'('||p6.at||')' bk
  from
       rv.pd p5
  join rv.pg g1 on g1.pi = p5.ii
  join rv.pd p6 on p6.ii = g1.vi
  where
     g1.rg = 'RE'
),
z3 as
( select
    connect_by_root ii root_ii,
    ii,
    vi,
    bn,
    at,
    connect_by_root re root_re,
    connect_by_root rba root_ba,
    connect_by_root rtk rt,
    sys_connect_by_path (vr, ' < ') kt,
    sys_connect_by_path (bn||'('||at||')', ' < ') bkt,
    sys_connect_by_path (fa,'*') cfa,
    sys_connect_by_path (sf,'x') sf,
    sys_connect_by_path (pi,' < ') pi,
    sys_connect_by_path (bk,' < ') bk,
    level lvl
  from z0
  start with re = :re
  connect by prior vi = ii
),
z6 as
( select
    p7.ii,
    p7.re,
    v2.vi
  from
       rv.pd p7
  join rv.pv v2 on v2.pi = p7.ii
  union
  select
    p8.ii,
    p8.re,
    g2.vi
  from
       rv.pd p8
  join rv.pg g2 on g2.pi = p8.ii
  where
    g2.rg = 'RE'
),
z5 as
( select
    level lvl
  from
    z6
  start with re = :re
  connect by prior vi = ii
),
z4 as
( select
    distinct lvl as n
  from z5
),
z2 as
( select
    z3.root_ii,
    z3.vi,
    z3.root_re,
    z3.root_ba,
    z3.rt,
    z3.kt,
    z3.bn,
    z3.at,
    z3.sf,
    z3.pi,
    z3.bk,
    to_number(regexp_substr(z3.cfa,'[^*]+',1,z4.n)) as cfa
  from z3
  join z4 on z4.n <= z3.lvl
  where z3.root_re = :re),
z1 as
( select
    z2.root_ii,
    z2.vi,
    z2.root_re,
    z2.root_ba,
    z2.rt,
    z2.kt,
    z2.bn,
    z2.at,
    z2.pi,
    z2.bk,
    z2.sf,
    round(exp(sum(ln(z2.cfa))),5) fa
  from
       z2
  where
    root_re = :re
  group by
    root_ii,
    vi,
    root_re,
    root_ba,
    rt,
    kt,
    bn,
    at,
    pi,
    bk,
    sf
),
bv as
( select
    p1.bn,
    p1.at,
    p1.da,
    p1.re,
    p1.ii,
    p1.ii root_ii,
    p1.re rh,
    'R' hk,
    to_char(p1.bn)||'('||p1.at||')' bk,
    '1' sf,
    1 fa,
    p1.be
  from
    rv.pd p1
  where
    p1.re = :re
  union
  select
    p2.bn,
    p2.at,
    p2.da,
    p2.re,
    p2.ii,
    z1.root_ii,
    z1.root_re||z1.kt,
    'R'||z1.pi,
    to_char(z1.root_ba)||'('||z1.rt||')'||Z1.bk bk,
    '1'||replace(z1.sf,'x','*') sf,
    z1.fa,
    p2.be
  from
    rv.pd p2
    join z1 on z1.vi = p2.ii
    where z1.root_re = :re
),
rv as
( select
    pr.pi,
    pr.rk,
    pr.om
  from
    rv.pr pr
    join rv.pd p on pr.pi = p.ii
  union
  select
    pg.pi,
    pg.mk,
    pg.om
  from
    rv.pg pg
    join rv.pd p on pg.pi = p.ii
  where pg.rg = 'RO'
)
select
  p0.da,
  p0.tt,
  bv.hk,
  bv.sf,
  round(bv.fa,6) fa,
  r1.ke,
  round(rv.om,3) ov,
  round(rv.om*bv.fa,3) oe
from rv
join bv on rv.pi = bv.ii
join rv.pd p0 on p0.ii = bv.root_ii
join rv.sr r1 on r1.ke = rv.rk
where
  p0.re = :re and
  p0.da between to_date(:startdate) and to_date(:enddate)+1
order by
  p0.da desc,
  bv.rh,
  r1.ro;
The used tables are not extremely large. They have

PD: 96175 rows
PG: 77014 rows
PR: 355692 rows
PV: 112859 rows
SR: 351 rows

On my old 10g machine I get the following result and execution plan:
DA                 TT HK           SF                                           FA KE      OV         OE
---------- ---------- ------------ ----------------------------------------- ----- ------- ---------- ----------
...
04.07.2012    3438.57 R < V < V    1* 0.999750/ 1.000000* 1.181958/ 1.181958 .99975   1097    230.364    230.306

274 rows selected.

Elapsed: 00:00:05.26

Execution Plan
--------------------------
Plan hash value: 235551927

------------------------------------------------------------------------------------------------------------------------------
| Id | Operation                                  | Name                        | Rows  | Bytes |TempSpc|Cost (%CPU)|Time    |
------------------------------------------------------------------------------------------------------------------------------
|   0| SELECT STATEMENT                           |                             |     3 | 18291 |       | 7360  (22)|00:01:29|
|   1|  TEMP TABLE TRANSFORMATION                 |                             |       |       |       |           |        |
|   2|   LOAD AS SELECT                           | SR                          |       |       |       |           |        |
|   3|    SORT UNIQUE                             |                             |   115K|  9304K|    22M| 4610  (19)|00:00:56|
|   4|     UNION-ALL                              |                             |       |       |       |           |        |
|*  5|      HASH JOIN                             |                             |   112K|  9118K|  4608K| 1631   (3)|00:00:20|
|   6|       TABLE ACCESS FULL                    | PD                          | 96175 |  3475K|       |  285   (4)|00:00:04|
|*  7|       HASH JOIN                            |                             |   112K|  5069K|  3200K|  806   (3)|00:00:10|
|   8|        TABLE ACCESS FULL                   | PD                          | 96175 |  2066K|       |  285   (4)|00:00:04|
|   9|        TABLE ACCESS FULL                   | PV                          |   112K|  2645K|       |  166   (5)|00:00:02|
|* 10|      HASH JOIN                             |                             |  2645 |   185K|       |  741   (4)|00:00:09|
|* 11|       HASH JOIN                            |                             |  2645 |   116K|       |  454   (4)|00:00:06|
|* 12|        TABLE ACCESS FULL                   | PG                          |  2645 | 60835 |       |  168   (4)|00:00:03|
|  13|        TABLE ACCESS FULL                   | PD                          | 96175 |  2066K|       |  285   (4)|00:00:04|
|  14|       TABLE ACCESS FULL                    | PD                          | 96175 |  2535K|       |  285   (4)|00:00:04|
|  15|   LOAD AS SELECT                           | SR                          |       |       |       |           |        |
|  16|    SORT UNIQUE                             |                             |   151K|  3399K|  9537K| 2203  (35)|00:00:27|
|  17|     UNION-ALL                              |                             |       |       |       |           |        |
|* 18|      HASH JOIN                             |                             |   112K|  2534K|  2352K|  689   (4)|00:00:09|
|  19|       TABLE ACCESS FULL                    | PD                          | 96175 |  1220K|       |  285   (4)|00:00:04|
|  20|       TABLE ACCESS FULL                    | PV                          |   112K|  1102K|       |  166   (5)|00:00:02|
|* 21|      HASH JOIN                             |                             | 38507 |   864K|       |  456   (4)|00:00:06|
|* 22|       TABLE ACCESS FULL                    | PG                          | 38507 |   376K|       |  168   (4)|00:00:03|
|  23|       TABLE ACCESS FULL                    | PD                          | 96175 |  1220K|       |  285   (4)|00:00:04|
|  24|   SORT ORDER BY                            |                             |     3 | 18291 |       |  547   (1)|00:00:07|
|* 25|    FILTER                                  |                             |       |       |       |           |        |
|  26|     NESTED LOOPS                           |                             |     3 | 18291 |       |  546   (1)|00:00:07|
|  27|      NESTED LOOPS                          |                             |     3 | 18231 |       |  543   (1)|00:00:07|
|  28|       NESTED LOOPS                         |                             |     1 |  6053 |       |  265   (0)|00:00:04|
|  29|        VIEW                                |                             |   263 |  1547K|       |    2   (0)|00:00:01|
|  30|         SORT UNIQUE                        |                             |       |       |       |           |        |
|  31|          UNION-ALL                         |                             |       |       |       |           |        |
|* 32|           TABLE ACCESS FULL                | PD                          |   262 |  8384 |       |  282   (3)|00:00:04|
|  33|           NESTED LOOPS                     |                             |     1 |  8112 |       |  459K (48)|01:31:53|
|* 34|            VIEW                            |                             |     1 |  8080 |       |  459K (48)|01:31:53|
|  35|             HASH GROUP BY                  |                             |     1 | 10121 |       |  459K (48)|01:31:53|
|  36|              MERGE JOIN                    |                             |   871M|  8213G|       |  259K  (7)|00:51:49|
|  37|               SORT JOIN                    |                             |   115K|  1109M|  1799M|  242K  (1)|00:48:31|
|* 38|                VIEW                        |                             |   115K|  1109M|       |    9  (78)|00:00:01|
|* 39|                 CONNECT BY WITH FILTERING  |                             |       |       |       |           |        |
|* 40|                  FILTER                    |                             |       |       |       |           |        |
|  41|                   COUNT                    |                             |       |       |       |           |        |
|  42|                    VIEW                    |                             |   115K|    16M|       |    9  (78)|00:00:01|
|  43|                     TABLE ACCESS FULL      | SYS_TEMP_0FD9DC297_EEDC4CCC |   115K|    16M|       |    9  (78)|00:00:01|
|* 44|                  HASH JOIN                 |                             |       |       |       |           |        |
|  45|                   CONNECT BY PUMP          |                             |       |       |       |           |        |
|  46|                   COUNT                    |                             |       |       |       |           |        |
|  47|                    VIEW                    |                             |   115K|    16M|       |    9  (78)|00:00:01|
|  48|                     TABLE ACCESS FULL      | SYS_TEMP_0FD9DC297_EEDC4CCC |   115K|    16M|       |    9  (78)|00:00:01|
|  49|                  COUNT                     |                             |       |       |       |           |        |
|  50|                   VIEW                     |                             |   115K|    16M|       |    9  (78)|00:00:01|
|  51|                    TABLE ACCESS FULL       | SYS_TEMP_0FD9DC297_EEDC4CCC |   115K|    16M|       |    9  (78)|00:00:01|
|* 52|               SORT JOIN                    |                             |   151K|  1921K|  5944K| 1485   (4)|00:00:18|
|  53|                VIEW                        |                             |   151K|  1921K|       |  746   (4)|00:00:09|
|  54|                 HASH UNIQUE                |                             |   151K|  1921K|  5944K|  746   (4)|00:00:09|
|  55|                  VIEW                      |                             |   151K|  1921K|       |    7  (72)|00:00:01|
|* 56|                   CONNECT BY WITH FILTERING|                             |       |       |       |           |        |
|* 57|                    FILTER                  |                             |       |       |       |           |        |
|  58|                     COUNT                  |                             |       |       |       |           |        |
|  59|                      VIEW                  |                             |   151K|  4878K|       |    7  (72)|00:00:01|
|  60|                       TABLE ACCESS FULL    | SYS_TEMP_0FD9DC298_EEDC4CCC |   151K|  4878K|       |    7  (72)|00:00:01|
|* 61|                    HASH JOIN               |                             |       |       |       |           |        |
|  62|                     CONNECT BY PUMP        |                             |       |       |       |           |        |
|  63|                     COUNT                  |                             |       |       |       |           |        |
|  64|                      VIEW                  |                             |   151K|  4878K|       |    7  (72)|00:00:01|
|  65|                       TABLE ACCESS FULL    | SYS_TEMP_0FD9DC298_EEDC4CCC |   151K|  4878K|       |    7  (72)|00:00:01|
|  66|                    COUNT                   |                             |       |       |       |           |        |
|  67|                     VIEW                   |                             |   151K|  4878K|       |    7  (72)|00:00:01|
|  68|                      TABLE ACCESS FULL     | SYS_TEMP_0FD9DC298_EEDC4CCC |   151K|  4878K|       |    7  (72)|00:00:01|
|  69|            TABLE ACCESS BY INDEX ROWID     | PD                          |     1 |    32 |       |    1   (0)|00:00:01|
|* 70|             INDEX UNIQUE SCAN              | PKPD                        |     1 |       |       |    0   (0)|00:00:01|
|* 71|        TABLE ACCESS BY INDEX ROWID         | PD                          |     1 |    26 |       |    1   (0)|00:00:01|
|* 72|         INDEX UNIQUE SCAN                  | PKPD                        |     1 |       |       |    0   (0)|00:00:01|
|  73|       VIEW                                 |                             |  1497 | 35928 |       |  277   (0)|00:00:04|
|  74|        SORT UNIQUE                         |                             |       |       |       |           |        |
|  75|         UNION-ALL PARTITION                |                             |       |       |       |           |        |
|  76|          NESTED LOOPS                      |                             |     6 |   186 |       |    5   (0)|00:00:01|
|  77|           TABLE ACCESS BY INDEX ROWID      | PR                          |     6 |   156 |       |    5   (0)|00:00:01|
|* 78|            INDEX RANGE SCAN                | PKPR                        |     6 |       |       |    3   (0)|00:00:01|
|* 79|           INDEX UNIQUE SCAN                | PKPD                        |     1 |     5 |       |    0   (0)|00:00:01|
|  80|          NESTED LOOPS                      |                             |     2 |    64 |       |    3   (0)|00:00:01|
|* 81|           TABLE ACCESS BY INDEX ROWID      | PG                          |     2 |    54 |       |    3   (0)|00:00:01|
|* 82|            INDEX RANGE SCAN                | PKPG                        |     4 |       |       |    2   (0)|00:00:01|
|* 83|           INDEX UNIQUE SCAN                | PKPD                        |     1 |     5 |       |    0   (0)|00:00:01|
|  84|      TABLE ACCESS BY INDEX ROWID           | SR                          |     1 |    20 |       |    1   (0)|00:00:01|
|* 85|       INDEX UNIQUE SCAN                    | PKSR                        |     1 |       |       |    0   (0)|00:00:01|
------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

 5 - access("P4"."II"="V1"."VI")
 7 - access("V1"."PI"="P3"."II")
10 - access("P6"."II"="G1"."VI")
11 - access("G1"."PI"="P5"."II")
12 - filter("G1"."VI" IS NOT NULL AND "G1"."RG"='RE')
18 - access("V2"."PI"="P7"."II")
21 - access("G2"."PI"="P8"."II")
22 - filter("G2"."RG"='RE')
25 - filter(TO_DATE(:STARTDATE)<=TO_DATE(:ENDDATE)+1)
32 - filter("P1"."RE"=:RE)
34 - filter("Z1"."ROOT_RE"=:RE)
38 - filter("Z3"."ROOT_RE"=:RE)
39 - access("II"=PRIOR "VI")
40 - filter("RE"=:RE)
44 - access("II"=PRIOR "VI")
52 - access(INTERNAL_FUNCTION("Z4"."N")<=INTERNAL_FUNCTION("Z3"."LVL"))
     filter(INTERNAL_FUNCTION("Z4"."N")<=INTERNAL_FUNCTION("Z3"."LVL"))
56 - access("II"=PRIOR "VI")
57 - filter("RE"=:RE)
61 - access("II"=PRIOR "VI")
70 - access("Z1"."VI"="P2"."II")
71 - filter("P0"."RE"=:RE AND "P0"."DA">=TO_DATE(:STARTDATE) AND "P0"."DA"<=TO_DATE(:ENDDATE)+1)
72 - access("P0"."II"="BV"."ROOT_II")
78 - access("PR"."PI"="BV"."II")
79 - access("PR"."PI"="P"."II")
81 - filter("PG"."RG"='RO')
82 - access("PG"."PI"="BV"."II")
83 - access("PG"."PI"="P"."II")
85 - access("R1"."KE"="RV"."RK")

Statistics
-------------------------
   2893 recursive calls
   1925 db block gets
  20616 consistent gets
   4949 physical reads
   3204 redo size
   9864 bytes sent via SQL*Net to client
   2449 bytes received via SQL*Net from client
     20 SQL*Net roundtrips to/from client
    108 sorts (memory)
      0 sorts (disk)
    274 rows processed
On the new machine I have no statistics as I gave up waiting. But I have an execution plan at least:
Execution Plan
--------------------------
Plan hash value: 249828818

------------------------------------------------------------------------------------------------------------------------------------------
| Id | Operation                                              | Name                        | Rows  | Bytes |TempSpc|Cost (%CPU)|Time    |
------------------------------------------------------------------------------------------------------------------------------------------
|   0| SELECT STATEMENT                                       |                             |       |    39M|       |  123K  (2)|00:24:48|
|   1|  TEMP TABLE TRANSFORMATION                             |                             |       |       |       |           |        |
|   2|   LOAD AS SELECT                                       | SYS_TEMP_0FD9D66C4_7D2B1EF2 |       |       |       |           |        |
|   3|    SORT UNIQUE                                         |                             |   115K|  8179K|  9792K| 4779  (22)|00:00:58|
|   4|     UNION-ALL                                          |                             |       |       |       |           |        |
|*  5|      HASH JOIN                                         |                             |   112K|  8019K|  4232K| 1821   (1)|00:00:22|
|   6|       TABLE ACCESS FULL                                | PD                          | 96175 |  3099K|       |  395   (1)|00:00:05|
|*  7|       HASH JOIN                                        |                             |   112K|  4408K|  2912K|  940   (1)|00:00:12|
|   8|        TABLE ACCESS FULL                               | PD                          | 96175 |  1784K|       |  395   (1)|00:00:05|
|   9|        TABLE ACCESS FULL                               | PV                          |   112K|  2314K|       |  224   (1)|00:00:03|
|* 10|      HASH JOIN                                         |                             |  2645 |   160K|       | 1016   (1)|00:00:13|
|* 11|       HASH JOIN                                        |                             |  2645 |   100K|       |  620   (1)|00:00:08|
|* 12|        TABLE ACCESS FULL                               | PG                          |  2645 | 52900 |       |  224   (1)|00:00:03|
|  13|        TABLE ACCESS FULL                               | PD                          | 96175 |  1784K|       |  395   (1)|00:00:05|
|  14|       TABLE ACCESS FULL                                | PD                          | 96175 |  2160K|       |  395   (1)|00:00:05|
|  15|   LOAD AS SELECT                                       | SYS_TEMP_0FD9D66C5_7D2B1EF2 |       |       |       |           |        |
|  16|    SORT UNIQUE                                         |                             |   151K|  2808K|  4184K| 2354  (37)|00:00:29|
|  17|     UNION-ALL                                          |                             |       |       |       |           |        |
|* 18|      HASH JOIN                                         |                             |   112K|  2094K|  2168K|  834   (1)|00:00:11|
|  19|       TABLE ACCESS FULL                                | PD                          | 96175 |  1033K|       |  395   (1)|00:00:05|
|  20|       TABLE ACCESS FULL                                | PV                          |   112K|   881K|       |  224   (1)|00:00:03|
|* 21|      HASH JOIN                                         |                             | 38507 |   714K|       |  620   (1)|00:00:08|
|* 22|       TABLE ACCESS FULL                                | PG                          | 38507 |   300K|       |  224   (1)|00:00:03|
|  23|       TABLE ACCESS FULL                                | PD                          | 96175 |  1033K|       |  395   (1)|00:00:05|
|  24|   SORT ORDER BY                                        |                             |       |    39M|    78M|  116K  (1)|00:23:23|
|* 25|    FILTER                                              |                             |       |       |       |           |        |
|  26|     NESTED LOOPS                                       |                             | 10055 |    39M|       |  108K  (1)|00:21:39|
|* 27|      HASH JOIN                                         |                             |   106K|  6670K|       | 1462   (1)|00:00:18|
|  28|       MERGE JOIN CARTESIAN                             |                             |    95 |  3800 |       |  398   (1)|00:00:05|
|* 29|        TABLE ACCESS FULL                               | PD                          |     1 |    22 |       |  395   (1)|00:00:05|
|  30|        BUFFER SORT                                     |                             |   351 |  6318 |       |    3   (0)|00:00:01|
|  31|         TABLE ACCESS FULL                              | SR                          |   351 |  6318 |       |    3   (0)|00:00:01|
|  32|       VIEW                                             |                             |   394K|  9239K|       | 1062   (1)|00:00:13|
|  33|        SORT UNIQUE                                     |                             |       |       |       |           |        |
|  34|         UNION-ALL                                      |                             |       |       |       |           |        |
|  35|          NESTED LOOPS                                  |                             |   355K|  9378K|       |  978   (4)|00:00:12|
|  36|           TABLE ACCESS FULL                            | PR                          |   355K|  7989K|       |  945   (1)|00:00:12|
|* 37|           INDEX UNIQUE SCAN                            | PKPD                        |     1 |     4 |       |    0   (0)|00:00:01|
|  38|          NESTED LOOPS                                  |                             | 38507 |  1015K|       |  227   (3)|00:00:03|
|* 39|           TABLE ACCESS FULL                            | PG                          | 38507 |   864K|       |  224   (1)|00:00:03|
|* 40|           INDEX UNIQUE SCAN                            | PKPD                        |     1 |     4 |       |    0   (0)|00:00:01|
|* 41|      VIEW                                              |                             |     1 |  4037 |       |    1   (0)|00:00:01|
|  42|       SORT UNIQUE                                      |                             |       |       |       |           |        |
|  43|        UNION-ALL PARTITION                             |                             |       |       |       |           |        |
|* 44|         TABLE ACCESS BY INDEX ROWID                    | PD                          |     1 |    28 |       |    2   (0)|00:00:01|
|* 45|          INDEX UNIQUE SCAN                             | PKPD                        |     1 |       |       |    1   (0)|00:00:01|
|  46|         NESTED LOOPS                                   |                             |     1 |  8108 |       |  304K (21)|01:00:51|
|  47|          TABLE ACCESS BY INDEX ROWID                   | PD                          |     1 |    28 |       |    2   (0)|00:00:01|
|* 48|           INDEX UNIQUE SCAN                            | PKPD                        |     1 |       |       |    1   (0)|00:00:01|
|* 49|          VIEW                                          |                             |     1 |  8080 |       |  304K (21)|01:00:51|
|  50|           SORT GROUP BY                                |                             |     1 | 10121 |       |  304K (21)|01:00:51|
|  51|            MERGE JOIN                                  |                             |   871M|  8213G|       |  247K  (2)|00:49:33|
|  52|             SORT JOIN                                  |                             |   115K|  1109M|  1799M|  242K  (1)|00:48:25|
|* 53|              VIEW                                      |                             |   115K|  1109M|       | 3927 (100)|00:00:48|
|* 54|               CONNECT BY NO FILTERING WITH START-WITH  |                             |       |       |       |           |        |
|  55|                VIEW                                    |                             |   115K|    16M|       |    4  (50)|00:00:01|
|  56|                 TABLE ACCESS FULL                      | SYS_TEMP_0FD9D66C4_7D2B1EF2 |   115K|    16M|       |    4  (50)|00:00:01|
|* 57|             SORT JOIN                                  |                             |   151K|  1921K|  5944K| 1450   (2)|00:00:18|
|  58|              VIEW                                      |                             |   151K|  1921K|       |  727   (2)|00:00:09|
|  59|               SORT UNIQUE                              |                             |   151K|  1921K|  2976K|  727   (2)|00:00:09|
|  60|                VIEW                                    |                             |   151K|  1921K|       | 1356 (100)|00:00:17|
|* 61|                 CONNECT BY NO FILTERING WITH START-WITH|                             |       |       |       |           |        |
|  62|                  VIEW                                  |                             |   151K|  4878K|       |    3  (34)|00:00:01|
|  63|                   TABLE ACCESS FULL                    | SYS_TEMP_0FD9D66C5_7D2B1EF2 |   151K|  4878K|       |    3  (34)|00:00:01|
------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

 5 - access("P4"."II"="V1"."VI")
 7 - access("V1"."PI"="P3"."II")
10 - access("P6"."II"="G1"."VI")
11 - access("G1"."PI"="P5"."II")
12 - filter("G1"."VI" IS NOT NULL AND "G1"."RG"='RE')
18 - access("V2"."PI"="P7"."II")
21 - access("G2"."PI"="P8"."II")
22 - filter("G2"."RG"='RE')
25 - filter(TO_DATE(:STARTDATE)<=TO_DATE(:ENDDATE)+1)
27 - access("R1"."KE"="RV"."RK")
29 - filter("P0"."RE"=:RE AND "P0"."DA"<=TO_DATE(:ENDDATE)+1 AND "P0"."DA">=TO_DATE(:STARTDATE))
37 - access("PR"."PI"="P"."II")
39 - filter("PG"."RG"='RO')
40 - access("PG"."PI"="P"."II")
41 - filter("P0"."II"="BV"."ROOT_II")
44 - filter("P1"."RE"=:RE)
45 - access("P1"."II"="RV"."PI")
48 - access("P2"."II"="RV"."PI")
49 - filter("Z1"."ROOT_RE"=:RE AND "Z1"."VI"="P2"."II" AND "Z1"."VI"="RV"."PI")
53 - filter("Z3"."ROOT_RE"=:RE)
54 - access("II"=PRIOR "VI")
     filter("RE"=:RE)
57 - access(INTERNAL_FUNCTION("Z4"."N")<=INTERNAL_FUNCTION("Z3"."LVL"))
     filter(INTERNAL_FUNCTION("Z4"."N")<=INTERNAL_FUNCTION("Z3"."LVL"))
61 - access("II"=PRIOR "VI")
     filter("RE"=:RE)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 11 2012
Added on Aug 8 2012
39 comments
2,029 views