MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:August 19 2009 11:54am
Subject:Re: bzr commit into mysql-5.0-bugteam branch (anurag.shekhar:2788)
Bug#44723
View as plain text  
Hi Anurag,

generally ok to push, but please find some comments inline.

On Thu, Aug 13, 2009 at 07:09:02PM +0000, Anurag Shekhar wrote:
> #At file:///home/anurag/mysqlsrc/mysql-5.0-bugteam-44723/ based on
> revid:li-bing.song@stripped
> 
>  2788 Anurag Shekhar	2009-08-14
>       Bug #44723 Larger read_buffer_size values can cause performance 
>                  decrease for INSERTs
>       
>       Large number of calls to 'memset' to initialize the bugger to mulls 
>       where causing the performance drop.
bugger to mulls? :)
s/where/were?

Ok, besides, I don't think that the problem was large number of calls to
'memset', but rather memset on large memory hunk.

I'd suggest the following statement:

Bulk inserts (multiple row, CREATE ... SELECT, INSERT ... SELECT) into
MyISAM tables were performed inefficiently. This was mainly affecting
use cases where read_buffer_size was considerably large (>256K) and low
number of rows was inserted (e.g. 30-100).

The problem was that during I/O cache initialization (this happens
before each bulk insert) allocated I/O buffer was unnecessarily
initialized to '\0'.

This was happening because of mess in flag values. MyISAM informs I/O
cache to wait for free space (if out of disk space) by passing
MY_WAIT_IF_FULL flag. Since MY_WAIT_IF_FULL and MY_ZEROFILL have the
same values, memory allocator was initializing memory to '\0'.

The performance gain provided with this patch may only be visible with
non-debug binaries, since safemalloc always initializes allocated memory
to 0xA5A5...

...skip...
> === modified file 'mysys/mf_iocache.c'
> --- a/mysys/mf_iocache.c	2007-03-28 17:46:42 +0000
> +++ b/mysys/mf_iocache.c	2009-08-13 19:08:56 +0000
> @@ -235,8 +235,8 @@ int init_io_cache(IO_CACHE *info, File f
>  	buffer_block *= 2;
>        if ((info->buffer=
>  	   (byte*) my_malloc(buffer_block,
> -			     MYF((cache_myflags & ~ MY_WME) |
> -				 (cachesize == min_cache ? MY_WME : 0)))) != 0)
> +			   MYF(((cache_myflags & ~ (MY_WME | MY_WAIT_IF_FULL)) |
> +				 (cachesize == min_cache ? MY_WME : 0))))) != 0)
Please remove tabs from modified lines. Make sure lines are under 80
characters. I don't think double parenthesis at MYF level are needed.

Regards,
Sergey
-- 
Sergey Vojtovich <svoj@stripped>
MySQL AB, Software Engineer
Izhevsk, Russia, www.mysql.com
Thread
bzr commit into mysql-5.0-bugteam branch (anurag.shekhar:2788)Bug#44723Anurag Shekhar13 Aug
  • Re: bzr commit into mysql-5.0-bugteam branch (anurag.shekhar:2788)Bug#44723Sergey Vojtovich19 Aug