Subject Re: [firebird-support] does the order of the conditions in the where clause matters??
Author Ann W. Harrison
Carlos GarcĂ­a Trujillo wrote:
> i've been reading about some SQL engines where the order of the
> conditions in the WHERE section of a query is significant...
> i wonder if this happen in firebird too??...

No. Firebird's query optimizer is cost based, not syntax based.
You express the query in the way that makes the most sense to you
and (within limits) Firebird will make it efficient.

> i know that the order of the relations in the FROM Section have a
> significance and so the use of "INNER JOIN" and "LEFT JOIN" as stuff
> like that

Actually, for inner joins, the order of tables in the query makes no
difference. Firebird picks the most efficient order of evaluation
based on cost.

The order of outer join terms is semantically significant and affects
the join order, but that's a characteristic of outer joins and is
common to all databases.