Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Posts
    66

    Unanswered: Regarding Cartesian Product

    Hi all,

    I've a query like this :
    select
    a.indid
    from
    master_table a,
    ind_phone b,
    ind_phone c,
    ind_phone d
    where
    a.indid=b.indid and b.tel='B' and
    a.indid=c.indid and c.tel='C' and
    a.indid=d.indid and d.tel='D'

    The master table has 100 millions of data.
    Now if ind_phone table has 600 millions of data with
    200 millions of data when tel='B'
    200 millions of data when tel='C'
    200 millions of data when tel='D'

    Then what will be the cartesian product of this query?

    I mean is it 100*200*200*200
    OR
    100*600*600*600

    Will Oracle go first to where clause then go for cartesian product ?

    or Will it go first to cartesian product then it will go for where clause ?

    Thanks ..
    himridul

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: Regarding Cartesian Product

    Could be either way. The optimizer will decide, after considering the statistics about your tables. Use EXPLAIN PLAN to see what the optimizer will do for a given SQL statement.

  3. #3
    Join Date
    Jan 2004
    Posts
    66
    ok ,I will see.
    himridul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •