The order of everything in sql can be reordered by the query planner at its discretion, if arithmetic allows it. This includes AND, OR, inner joins, some cases of outer joins, etc. It can also reorganize IN queries, place subqueries, etc.
So yes, it will find your correct index, etc.
Beware not to let it explode in your face. This statement, for example:
select y <> 0 and (x / y) > 0;
it never creates a problem, say, in C, but in SQL the scheduler can fully evaluate the right side first and strangle division by a zero error.
If you want to force an order, you need to use the case statement:
select case when y <> 0 then (x / y) > 0 else false end;
Last note: for massive queries, complete joins and subqueries, planners usually encounter thresholds for which they no longer try to use all possible plans, and achieve a reasonably good query using genetic algorithms. When they do this, the connection order, etc. Counts.
source share