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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Forcing Oracle to use an order in the from clause

Re: Forcing Oracle to use an order in the from clause

From: Jim Smith <jim_at_jimsmith.demon.co.uk>
Date: 1997/04/19
Message-ID: <+ODr3AAIZIWzEwjv@jimsmith.demon.co.uk>#1/1

In article <3357F808.7DD3_at_pop-milpitas.lsil.com>, Boris Panteleev <borispan_at_pop-milpitas.lsil.com> writes
>
>amit srivastava wrote:
>>
>> Can you force Oracle to use a particular table order in the
>> from clause? Esp. if you have outer joins in them?
>>
>> Thank you for any information.
>> -amit
>
>You can.
>By default Oracle reads the last table in the FROM clause FIRST.
>So when you optimize your queries make sure the order of the tables
>listed in FROM consistent with their row number and overall size.
>Also make sure that the most restrictive table is processed first..this
>will reduce significantly the overall number of join rows that are
>spooled in the memory/alternatively temp space.
>
>Boris

This isn't really true any more. With the cost based optimiser, order of tables has no effect. Under the rule based optimiser, if it couldn't select a driving table after applying its rules to the where clause, then it would take the order of tables into account.

-- 
Jim Smith
Received on Sat Apr 19 1997 - 00:00:00 CDT

Original text of this message

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