this picture:

And in general the important thing of an SQL query is
-> the "ON" and the "WHERE" clause will be resolved left to right -> so first we use indexed fields and the smalles possible set and than we use the others. This makes your query much faster
you can always use "EXPLAIN" in front of your query.
Edit:
-> the "ON" and the "WHERE" clause will be resolved left to right -> so first we use indexed fields and the smalles possible set and than we use the others. This makes your query much faster
as pointed out below by Bill O'Neil this is not true, the query optimizer does usually fix this problem. It's an old habit that's got stuck
here is detailed explaination how a query optimizer works in general
stackoverflow.com/questions/4035760/does-the-orde…
However on certain database engines sadly it still can make a difference.
j
stuff ;)