From 9b9546edbc095e061167588f672549103627bf98 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 Nov 2002 22:56:57 +0200 Subject: Try to optimize the cache buffer size needed for bulk_insert Fix for shutdown on Mac OS X include/my_tree.h: Try to optimize the cache buffer size needed for bulk_insert myisam/mi_write.c: Try to optimize the cache buffer size needed for bulk_insert mysql-test/r/bdb.result: Make test repeatable mysql-test/t/bdb.test: Make test repeatable mysys/tree.c: Try to optimize the cache buffer size needed for bulk_insert sql/mysql_priv.h: Small optimization sql/mysqld.cc: Fix for shutdown on Mac OS X sql/sql_insert.cc: Try to optimize the cache buffer size needed for bulk_insert sql/sql_yacc.yy: Call thd->strmake() instead of sql_strmake() sql/table.cc: Try to optimize the cache buffer size needed for bulk_insert sql/table.h: Try to optimize the cache buffer size needed for bulk_insert --- mysys/tree.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'mysys/tree.c') diff --git a/mysys/tree.c b/mysys/tree.c index 2ac2c88fd66..ea5cf79f084 100644 --- a/mysys/tree.c +++ b/mysys/tree.c @@ -45,7 +45,8 @@ #define BLACK 1 #define RED 0 -#define DEFAULT_ALLOC_SIZE (8192-MALLOC_OVERHEAD) +#define DEFAULT_ALLOC_SIZE 8192 +#define DEFAULT_ALIGN_SIZE 8192 static void delete_tree_element(TREE *,TREE_ELEMENT *); static int tree_walk_left_root_right(TREE *,TREE_ELEMENT *, @@ -72,8 +73,9 @@ void init_tree(TREE *tree, uint default_alloc_size, uint memory_limit, DBUG_ENTER("init_tree"); DBUG_PRINT("enter",("tree: %lx size: %d",tree,size)); - if (!default_alloc_size) - default_alloc_size= DEFAULT_ALLOC_SIZE; + if (default_alloc_size < DEFAULT_ALLOC_SIZE) + default_alloc_size= DEFAULT_ALLOC_SIZE; + default_alloc_size= MY_ALIGN(default_alloc_size, DEFAULT_ALIGN_SIZE); bzero((gptr) &tree->null_element,sizeof(tree->null_element)); tree->root= &tree->null_element; tree->compare=compare; -- cgit v1.2.1