Quote:
Originally posted by abhaysk
Order of table may not matter ... not sure
Order of columns in where clause wud matter some times...
it wud be best if most restrictive column is preceded before any columns...(though it wud go for toss if not indexed col)
The order in which columns are indexes...if used in where clause in same order wud have beter performance ( i blv )..
if i am wrong please bark at me...
Abhay.
With the CBO, the order of the entries in the FROM and WHERE clause do not matter 99% of the time. Having said that, the best way to structure a statement, IMHO, is to bring one table at a time into the WHERE clause and join it to everything that's already there. Think like the compiler and bring the tables into the WHERE clause in the same order you want the optimizer to. Then change the FROM clause to match this order. This has several benefits: