From: Øystein Grøvlen Date: September 28 2009 1:21pm Subject: Re: bzr commit into mysql-5.4 branch (epotemkin:2864) Bug#34384 List-Archive: http://lists.mysql.com/commits/84857 Message-Id: <4AC0B85C.1020309@sun.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Evgeny Potemkin wrote: > Hi, > > The bug#34384 is about UPDATE being too slow. > > See: > create table t(a int primary key, ...); > insert ... > update ... where a='9999999999999999'; > > As you can see, a is an INT, and the constant is a STRING. > To correctly compare them we convert both to DOUBLE. > Obviously, in this case the index over "a" can't be used. > Currently left & right parts of comparison are converted immediately > before comparison is done. This is done for each row. It's ok for a > field, but the converted constant can be cached. This patch implements > caching of constants. > This allows to speedup a bit comparison on large record sets, but isn't > noticeable on small ones. Hi, In my opinion, performance fixes needs to be justified by some quantitative measures. I do not think we should make the code more complex unless it can be shown that it gives significant performance benefits. In this particular case, even if there is a significant performance improvements in itself, it will be insignificant compared to what the user could achieved by casting the string to an int. Anyhow, I will leave it to Sergei to decide whether this is a desired change or not, and get back to you with my specific comments on the patch. > The bug shown by Sergey is about wrongly used index for the SELECT > i.e. a different one, and will be addressed in a different bug report. OK, Good. -- Øystein