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

Home -> Community -> Usenet -> c.d.o.server -> Re: Does order in from and where clause matter?

Re: Does order in from and where clause matter?

From: Jerry Gitomer <jgitomer_at_hbsrx.com>
Date: Thu, 10 Jun 1999 14:39:26 -0400
Message-ID: <7jp509$4f5$1@autumn.news.rcn.net>


Hi Frank,

    When using the Rule Based Optimizer the order in which the tables are specified in the FROM section of the SELECT is significant. When using the Cost Based Optimizer it shouldn't make any difference.

    I recall reading somewhere that if one of the sides of a WHERE clause contains a function that performance may vary depending on which side of the = sign the function is located, but I don't know if this is urban legend (should that be RDBMS legend?) or fact.

regards

Jerry Gitomer


Frank Calfo wrote in message <01beb356$9dd390c0$e401010a_at_FRANK>...
>If a query is selecting from multiple, joined tables
>does the order of the tables in the from clause effect the efficiency of
>the query?
>
>For example (excluding the where clause):
> Does "select emp.name,
> group.name
> from emp,
> group "
> execute any different than
> "select emp.name,
> group.name
> from group,
> emp"
>
>Does the order of the tables in the where clause effect the efficiency of
>the query?
>
> Does "select emp.name,
> group.name,
> type.desc
> from emp,
> group,
> type
> where emp.empid = group.empid and
> emp.typeid = type.typeid"
> execute any different than
> "select emp.name,
> group.name,
> type.desc
> from emp,
> group,
> type
> where emp.typeid = type.typeid and
> emp.empid = group.empid"
>
>Does it matter which side of the equal sign in the where clase that the
>tables are listed?
>
>For example: does "emp.empid = group.empid"
> execute any differently than "group.empid =
>emp.empid"
>
>Thanks.
>
Received on Thu Jun 10 1999 - 13:39:26 CDT

Original text of this message

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