db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <knut.hat...@oracle.com>
Subject Re: How AND clauses are evaluated in Derby
Date Tue, 21 Jun 2011 11:17:16 GMT
Masood Mortazavi <masoodmortazavi@gmail.com> writes:

> When a Derby "select" executes in the case when "where" is followed by
> multiple conjoined AND clauses, will all the AND clauses be evaluated
> even if the first one is false, in the scan?

Derby will stop evaluating the clauses once one evaluates to false. Note
however that the optimizer may reorder the AND clauses for efficiency,
so if you code your application to rely on the short-circuiting (for
example if the AND clauses call functions with side effects), the
results may not be what you expect.

Knut Anders

View raw message