Gewusst wie: optimieren der oracle Abfrage mit 'merge join-das kartesische" im plan?

Abfrage:

select max(b.counter) as counter,
       b.m_group,
       b.m_code,
       a.s_id,
       s.id_sk
  from tbl_various a, tbl_map b, tbl_sheet s
 where coalesce(b.part, a.part) = a.part
   and coalesce(b.nums, to_number(a.nums)) = a.nums
   and coalesce(b.interc, a.interc) = a.interc
   and coalesce(b.segment, a.segment) = a.segment
   and coalesce(b.acountry, a.acountry) = a.acountry_midas
   and coalesce(b.orig_name, a.orig_name) = a.orig_name
   and coalesce(b.fact, a.fact) = a.fact
   and b.sect is not null
   and s.m_code = b.m_code
 group by b.m_group, b.m_code, a.s_id, s.id_sk;

Plan:

SELECT STATEMENT, GOAL = ALL_ROWS       86763   1           169
 HASH GROUP BY                          86763   1           169
  HASH JOIN                             86762   1           169
   TABLE ACCESS FULL    TBL_MAP         2       1717        92718
   MERGE JOIN CARTESIAN                 79688   300133251   34515323865
    TABLE ACCESS FULL   TBL_SHEET       5       912         18240
    BUFFER SORT                         79682   329274      31281030
     TABLE ACCESS FULL  TBL_VARIOUS     87      329274      31281030

Gruppe durch zu langsam ist... Wie wird es beschleunigen?

  • Haben Sie versucht, einen outer-join für die Tabelle tbl_map?
  • Btw, was ist der Punkt, der to_number(a.nums) Teil?
InformationsquelleAutor DmitryB | 2012-03-01
Schreibe einen Kommentar