Re: Order of clauses in SELECT...WHERE

From: Steve <stephen_wilcock_at_hotmail.com>
Date: 4 Oct 2002 03:05:56 -0700
Message-ID: <9397750b.0210040205.622e35cc_at_posting.google.com>


mstanbrook_at_yahoo.com (Michael Stanbrook) wrote in message news:<4df22773.0210031802.e46997c_at_posting.google.com>...
> Situation:
>
> SELECT *
> FROM A, B
> WHERE
> A.CHILDID=B.PARENTID
> AND B.STATUS='GOOD'
>
> Say for the sake of argument that B.ParentID is not indexed in table
> B, but B.STATUS is.
>
> Does putting changing the order of the WHERE clauses have any effect
> on the index usage and/or performance?
>
> e.g.
>
> SELECT *
> FROM A, B
> WHERE
> B.STATUS='GOOD'
> AND A.CHILDID=B.PARENTID
It depends, but basically Oracle makes an attempt to choose the most efficient join order for you. The order that the joins are made in _does_ make a difference but don't think the order that you list them dictates this. This should answer your questions...

http://www.znow.com/sales/oracle/server.816/a76992/optimops.htm#39473

  • see the sections on "Choosing Execution Plans for Joins"
Received on Fri Oct 04 2002 - 12:05:56 CEST

Original text of this message