List:General Discussion« Previous MessageNext Message »
From:Jerry Schwartz Date:March 15 2011 5:45pm
Subject:RE: "IF"
View as plain text  
>-----Original Message-----
>Sent: Monday, March 14, 2011 8:52 PM
>To: Johan De Meersman
>Cc: mysql@stripped
>Subject: Re: "IF"
>>>>> 2011/03/14 16:08 +0100, Johan De Meersman >>>>
>I'm afraid I'm not authoritative on this, but it seems to me that it would be
>very very bad if the third, unused expression were to be evaluated - not only
>from a performance point of view, but who is to say that that expression is 
>a user-defined function that modifies the database ?
>Yes, but Access s "IIF", of the same use, evaluates all three, and the
>documentation explicitly says so. MySQL s, that I have seen, says neither.
>Assuming the worst is safer, and then one uses CASE ..., but if not, ....
[JS] Also some optimizers (and I don't know if MySQL is that clever) will 
figure out which term is the cheapest to evaluate, and will change the order 
of evaluation.


Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341
E-mail: jerry@stripped
Web site:

>MySQL General Mailing List
>For list archives:
>To unsubscribe:

"IF"hsv14 Mar
  • Re: "IF"Johan De Meersman14 Mar
    • Re: "IF"hsv15 Mar
      • Re: "IF"Peter Brawley15 Mar
      • Re: "IF"Johan De Meersman15 Mar
      • RE: "IF"Jerry Schwartz15 Mar
Re: "IF"Prathima Rao15 Mar