We help IT Professionals succeed at work.
Get Started

Tuning required for full outer join

sakthikumar
sakthikumar asked
on
299 Views
Last Modified: 2014-09-01
Below is my query and cost, I tried many indexes, but my cost remains huge.
Can we do anything for this.? Let me know if you need more details.

Query :

SELECT MD.WEIGHT md_weight, V.WEIGHT v_weight
  FROM GCB_DBA.GCB_CARGO_CAT_MAPPING m
  LEFT join GCB_DBA.GCB_CARGO_CAT_MAPPING_DTLS MD
    on (M.MAPPING_ID = MD.MAPPING_ID)
  full outer join gencargo.vehiclelist_dsch v
    on (v.bol_no = m.bol_no and v.rotation_no = m.rotation_no and
       (v.weight = md.weight / md.quantity) OR MD.WEIGHT IS NULL)
 RIGHT JOIN GENCARGO.TRACK_DISCH_LIST T
    ON ((T.BOL_NO = V.BOL_NO AND T.ROTATION_NO = V.ROTATION_NO) OR
       (T.ROTATION_NO = M.ROTATION_NO AND T.BOL_NO = M.BOL_NO))
 where T.CCM_FLAG = 'N'
 GROUP BY MD.WEIGHT, V.WEIGHT


PLAN :

SELECT STATEMENT, GOAL = ALL_ROWS                  61021      7435      334575
 HASH GROUP BY                  61021      7435      334575
  NESTED LOOPS OUTER                  61019      7435      334575
   TABLE ACCESS FULL      GENCARGO      TRACK_DISCH_LIST      3      3      57
   VIEW      SYS            20339      2974      77324
    VIEW      SYS            20339      2974      226024
     UNION-ALL                              
      NESTED LOOPS OUTER                  20179      2513      158319
       HASH JOIN OUTER                  19      2513      62825
        TABLE ACCESS FULL      GCB_DBA      GCB_CARGO_CAT_MAPPING      9      1661      21593
        TABLE ACCESS FULL      GCB_DBA      GCB_CARGO_CAT_MAPPING_DTLS      9      2513      30156
       VIEW      SYS            8      1      38
        TABLE ACCESS FULL      GENCARGO      VEHICLELIST_DSCH      8      1      25
      FILTER                              
       TABLE ACCESS FULL      GENCARGO      VEHICLELIST_DSCH      8      461      11525
       FILTER                              
        NESTED LOOPS OUTER                  4      1      25
         TABLE ACCESS FULL      GCB_DBA      GCB_CARGO_CAT_MAPPING      2      1      13
         TABLE ACCESS BY INDEX ROWID      GCB_DBA      GCB_CARGO_CAT_MAPPING_DTLS      2      1      12
          INDEX RANGE SCAN      GCB_DBA      GCB_CARGO_CAT_MAPPING_DTLS_IND      1      1
Comment
Watch Question
CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2020
Commented:
This problem has been solved!
Unlock 3 Answers and 7 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE