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 -> SQL code tuning

SQL code tuning

From: Jason <foucault4_at_home.com>
Date: Sun, 14 Oct 2001 12:30:18 GMT
Message-ID: <uzfy7.128431$5A3.40183995@news1.rdc2.pa.home.com>


hi everyone...
i've been combing all the books and online docs i can find looking for information on the order in which oracle interprets an sql statement and how changing the code may affect performance. i know oracle reads the clauses (From clause, Select clause, etc.) in a particular order, but what i can't seem to find is does it matter what order you put the joins and/or selection criteria in the WHERE clause? For example, is there a difference between the following where clauses in terms of how oracle executes them?

select ...
from t1
where t1.f1 = 'abc'
and t1.f2 = 'xyz'
and t1.f3 = 123

where t1.f3 = 123
and t1.f2 = 'xyz'
and t1.f1 = 'abc'

i've heard that oracle will evaluate the criteria in reverse order, that is from the bottom up so that the last criteria in the clause is the first one to be searched for in the table or index. however my experience seems to indicate this is not true. does anyone know for sure or could you point me to a doc that discusses this?
thanks! Received on Sun Oct 14 2001 - 07:30:18 CDT

Original text of this message

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