Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: joins and performances : general question
Yes, you should actually order the tables in such a way that the
table with the least number of selected rows should be placed first in the
join (i.e. its selectivity should be low) and so on. this is just like the
case of optimal matrix chain multipication problem.
A database engine would usually do all this stuff for you since now a
days they have optimizers which are sophisticated.
Outer joins should only be used if you want to deal with null values.
-Aakash
Christian Bruno mailed on Today :
hello,
it is a very general question :
i have to write sql queries using lot of Joins (mainly left outer and inner joins)
is there rule(s) to apply to write these sql orders, having knowledge of the average number of rows in my tables ? for example : which order to use for joins in a particular query ? is it better to begin or to end with the join that retrieves the more rows in the database ? it is better to use INNER joins than LEFT OUTER JOINS ?
thanks for any comments or ideas !
Regards,
Christian
Aakash Bordia, MS candidate
Department of Computer Science, 1252 DCL
University of Illinois, Urbana Champaign
Phone : 217-332-2397(H) 217-244-7202(O)
Received on Mon Nov 22 1999 - 23:07:23 CST
![]() |
![]() |