List:Commits« Previous MessageNext Message »
From:Konstantin Osipov Date:July 31 2008 5:05pm
Subject:Re: bzr commit into mysql-5.0 branch (kgeorge:2650) Bug#37662
View as plain text  
* 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?

-- 
Thread
bzr commit into mysql-5.0 branch (kgeorge:2650) Bug#37662Georgi Kodinov30 Jul
  • Re: bzr commit into mysql-5.0 branch (kgeorge:2650) Bug#37662Konstantin Osipov31 Jul