Guest_imported
New member
- Jan 1, 1970
- 0
While a result set should not be different regardless of the WHERE clause ordering, the question of proper ordering came up in optimization. Assume a FROM clause as follows where data is retrieved from all tables:
FROM (tables)A, B, C, D
Should the ordering of the WHERE clause follow logically (which is easier to read). In otherwords:
Where A.1 = B.1
and A.2 = B.2
and C.2 = B.2
and C.3 = B.3
and D.4 = C.4
or does skipping around matter for optimization purposes.
For example:
Where D.4 = C.4
and C.2 = B.2
and A.1 = B.1
and C.3 = B.3
and A.2 = B.2
Thanks in advance
Nicatt
FROM (tables)A, B, C, D
Should the ordering of the WHERE clause follow logically (which is easier to read). In otherwords:
Where A.1 = B.1
and A.2 = B.2
and C.2 = B.2
and C.3 = B.3
and D.4 = C.4
or does skipping around matter for optimization purposes.
For example:
Where D.4 = C.4
and C.2 = B.2
and A.1 = B.1
and C.3 = B.3
and A.2 = B.2
Thanks in advance
Nicatt