>>>> 2011/05/12 15:15 +0200, misiaq >>>>
> Is the optimizer so clever as to set that test outside the expression, and only then
> evaluate it when "houmuch" and "SharePrice" are not equal?
Try it yourself:
mysql > explain extended select * from table1;
mysql > show warnings;
You will see the optimized query.
Not much of an explanation of "EXPLAIN"--and this command is mostly about indexing and
joining, in SQL of course of immens importance, and, to be sure, finding "houmuch" in my
query costs JOINing and SUMming, but I see nothing relevant to my question. On the other
hand, maybe finding "houmuch" costs so much more than the rest of the expression that it
does not matter.
In any case, there is here no answer to my question.