From 44d91e0a1f3b404beb4c1bd4706371914ca1bce8 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Jun 2002 13:20:02 +0000 Subject: do not use bulk insert tree code if ``myisam_bulk_insert_tree_size'' is too small --- myisam/mi_write.c | 3 ++- myisam/myisamdef.h | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'myisam') diff --git a/myisam/mi_write.c b/myisam/mi_write.c index 5a2711aac92..1497ed6cd63 100644 --- a/myisam/mi_write.c +++ b/myisam/mi_write.c @@ -821,7 +821,8 @@ int _mi_init_bulk_insert(MI_INFO *info) } } - if (num_keys==0 || num_keys>myisam_bulk_insert_tree_size) + if (num_keys==0 || + num_keys * MI_MIN_SIZE_BULK_INSERT_TREE > myisam_bulk_insert_tree_size) return 0; info->bulk_insert=(TREE *) diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h index e9d3461fe9a..fc46b5ecd5c 100644 --- a/myisam/myisamdef.h +++ b/myisam/myisamdef.h @@ -370,8 +370,10 @@ struct st_myisam_info { #define MI_MAX_KEY_BLOCK_SIZE (MI_MAX_KEY_BLOCK_LENGTH/MI_MIN_KEY_BLOCK_LENGTH) #define MI_BLOCK_SIZE(key_length,data_pointer,key_pointer) ((((key_length+data_pointer+key_pointer)*4+key_pointer+2)/myisam_block_size+1)*myisam_block_size) -#define MI_MAX_KEYPTR_SIZE 5 /* For calculating block lengths */ -#define MI_MIN_KEYBLOCK_LENGTH 50 /* When to split delete blocks */ +#define MI_MAX_KEYPTR_SIZE 5 /* For calculating block lengths */ +#define MI_MIN_KEYBLOCK_LENGTH 50 /* When to split delete blocks */ + +#define MI_MIN_SIZE_BULK_INSERT_TREE 16384 /* this is per key */ /* The UNIQUE check is done with a hashed long key */ -- cgit v1.2.1