* Georgi Kodinov <kgeorge@stripped> [08/07/31 20:44]:
> 2650 Georgi Kodinov 2008-07-30
> Bug#37662 : nested if() inside sum() is parsed in exponential time
>
> min() and max() functions are implemented in MySQL as macros.
> This means that max(a,b) is expanded to: ((a) > (b) ? (a) : (b))
> Note how 'a' is quoted two times.
> Now imagine 'a' is a recursive function call that's several 10s of levels
> deep.
> And the recursive function does max() with a function arg as well to dive
> into
> recursion.
> This means that simple function call can take most of the clock time.
> Identified and fixed several such calls to max()/min() : including the IF()
> sql function implementation.
Why not get rid of the crappy macro instead?
--