Home » RDBMS Server » Performance Tuning » oracle reads from buttom to top
oracle reads from buttom to top [message #203960] Fri, 17 November 2006 01:45 Go to next message
bagulia_pilla
Messages: 25
Registered: July 2006
Junior Member
Please help what is mean by oracle reads from buttom to top ?
do we need to write the table order with respect to no. of records in the table ?

Can any one help me ?

Thanks in advance .
Re: oracle reads from buttom to top [message #203972 is a reply to message #203960] Fri, 17 November 2006 02:47 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It was the issue with Oracle 7, where conditions written in the WHERE clause were read bottom-up. Since Oracle 8, SQL parsing engine was optimized and now order of WHERE conditions doesn't really matter.
Re: oracle reads from buttom to top [message #204023 is a reply to message #203972] Fri, 17 November 2006 06:25 Go to previous messageGo to next message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
Not entirely true. Actually, I don't think it's even remotely true, but I'm leaving some wriggle-room in case I'm proved wrong.

Since forever (I go back as far as v5.1b) the order of predicates both has and hasn't mattered.

- If Oracle is going to use an index to resolve a predicate, then it does not matter where it appears in the WHERE clause. This is regardless of RBO or CBO.

- Predicates that do not use indexes are applied bottom-up for AND clauses, and top-down for OR clauses. So always place "most likely to succeed predicates at the top.

The OP is possibly referring to the fact that the SQL parser starts at the end of the query. You can see this in syntax errors - when you have 2 or more syntax errors in a SQL, it tends to find the bottom one first.

Ross Leishman
Re: oracle reads from buttom to top [message #204127 is a reply to message #204023] Sat, 18 November 2006 00:32 Go to previous message
bagulia_pilla
Messages: 25
Registered: July 2006
Junior Member
Thank you so much..

Now I know
if there is any error in query.. the oracle finds error in buttom intead of top..
So it is better to follow buttom-top in where condition..


Previous Topic: Query performance
Next Topic: Oracle 9i materialized view refresh problems
Goto Forum:
  


Current Time: Sun Dec 04 02:29:29 CST 2016

Total time taken to generate the page: 0.04563 seconds