That would be normal for most programming languages, but I can't find 
that spelled out anywhere in the MySQL documentation.  However the 
comments at the bottom of this page:

http://dev.mysql.com/doc/refman/5.1/en/where-optimizations.html

are interesting.

-- Walt

On 12/23/2011 04:48 PM, Wade Preston Shearer wrote:
> Am I correct in my understanding that the right side of an OR statement in an 
> MySQL query doesn't get evaluated unless the left side fails? I have a query 
> where the left-side case of an OR occurs often and produces an efficient 
> query and the right-side happens only occasionally and produces a slower, 
> less efficient query. If the query always checks both but only uses the left 
> if it is true, then I'd be better served to move it into two queries. If it 
> only checks the right-side condition if the left-side fails though, then 
> keeping it in one makes sense.
>
> _______________________________________________
>
> UPHPU mailing list
> [email protected]
> http://uphpu.org/mailman/listinfo/uphpu
> IRC: #uphpu on irc.freenode.net


_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to