Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Optimization: change in access path to one table changes join strategy to another table...

Re: Optimization: change in access path to one table changes join strategy to another table...

From: Tim Hopkins <oracle-l_at_timothyhopkins.net>
Date: Thu, 24 Aug 2006 15:14:32 -0000 (GMT)
Message-ID: <52917.192.165.213.18.1156432472.squirrel@192.165.213.18>


Hi John,

Looks like transitivity.

  1. The join condition "itemtype.sm29_logo_seat_num (+) = tsm66.sm66_seat_num" indicates these two columns should be considered equal, thus the where condition "sm66_seat_num = 1234" can be transformed internally into "itemtype.sm29_logo_seat_num = 1234". This would then allow an index range lookup on your sm29_logo_seat_num table.
  2. Conversely, when using "UPPER(sm66_multi_des) LIKE '1234'" there is no transitivity and thus the only conditions on sm29_log_seat_num are the join conditions. If the CBO uses that as the leading table then there are no predicates available at that stage of the execution plan and thus a full scan makes sense.

Cheers,
Tim

> Hi
>
> *** The query:
> SELECT
> itemtype.logo,
> tsm66.sm66_seat_num
> FROM tsm66_attrmultimedia tsm66,
> tsm30_format tsm30,
> (SELECT
> /*+ MERGE
> INDEX(tsm29 ism29_i02)
> INDEX(tsm17 ism17_p01)
> */
> tsm29.sm29_logo_seat_num,
> tsm29.sm29_page_numb_num,
> MAX(DECODE(tsm17.sm18_info_num, 78,0, 1)) logo
> FROM tsm29_multimedia tsm29,
> tsm17_item tsm17
> WHERE tsm17.sm17_item_num = tsm29.sm17_item_num
> GROUP BY tsm29.sm29_logo_seat_num,
> tsm29.sm29_page_numb_num
> ) itemtype
> WHERE tsm30.sm30_frmt_num = tsm66.sm30_frmt_num
> AND itemtype.sm29_logo_seat_num (+) = tsm66.sm66_seat_num
> AND itemtype.sm29_page_numb_num (+) = tsm66.sm66_page_numb_num
> -- and UPPER(sm66_multi_des) LIKE '1234'
> and sm66_seat_num = 1234
> ;

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Aug 24 2006 - 10:14:32 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US