oracle reads from buttom to top [message #203960] |
Fri, 17 November 2006 01:45 |
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 #204023 is a reply to message #203972] |
Fri, 17 November 2006 06:25 |
rleishman
Messages: 3728 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
|
|
|
|