Hi Jerry, all!
Jerry Schwartz wrote:
>> [[...]]
>>
>> Maybe:
>>
>> WHERE coalesce(x, 17) = 17
>>
>>
> [JS] Interesting suggestion, but
>
> us-gii >select benchmark(10000000,(7=7 or null is null));
> [[...]]
> 1 row in set (0.34 sec)
>
> us-gii >select benchmark(100000000,coalesce(null,7));
> [[...]]
> 1 row in set (2.61 sec)
>
> It looks like COALESCE() is slower. Of course this isn't anything like a real
> test. [[...]]
Both your statements use constants only, so they can be evaluated during
statement analysis and need not access any data.
I don't think the time relation you get here can be applied to a
statement really getting column values from a table and using them in a
predicate.
Regards,
Jörg
--
Joerg Bruehe, MySQL Build Team, Joerg.Bruehe@stripped
Sun Microsystems GmbH, Komturstraße 18a, D-12099 Berlin
Geschaeftsfuehrer: Thomas Schroeder, Wolfgang Engels
Vorsitzender des Aufsichtsrates: Martin Haering Muenchen: HRB161028