From 2d28c646cbd53c1fcdf800dc408580aa5377f3b9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Jul 2001 21:18:57 +0200 Subject: memory-limited tree bulk inserts optimization: caching keys in binary tree include/my_base.h: bulk inserts optimization: caching keys in binary tree include/my_tree.h: memory-limited tree include/myisam.h: bulk inserts optimization: caching keys in binary tree isam/isamlog.c: memory-limited tree isam/pack_isam.c: memory-limited tree myisam/ft_boolean_search.c: memory-limited tree myisam/ft_nlq_search.c: memory-limited tree myisam/ft_parser.c: memory-limited tree myisam/ft_stopwords.c: memory-limited tree myisam/mi_extra.c: bulk inserts optimization: caching keys in binary tree myisam/mi_open.c: bulk inserts optimization: caching keys in binary tree myisam/mi_static.c: bulk inserts optimization: caching keys in binary tree myisam/mi_write.c: bulk inserts optimization: caching keys in binary tree myisam/myisamdef.h: bulk inserts optimization: caching keys in binary tree myisam/myisamlog.c: memory-limited tree myisam/myisampack.c: memory-limited tree mysql-test/mysql-test-run.sh: memory-limited tree mysql-test/t/alter_table.test: make it faster mysys/tree.c: memory-limited tree sql/ha_myisam.cc: bulk inserts optimization: caching keys in binary tree sql/item_sum.cc: memory-limited tree sql/mysqld.cc: bulk inserts optimization: caching keys in binary tree sql/sql_analyse.h: memory-limited tree sql/uniques.cc: memory-limited tree --- include/my_base.h | 4 +++- include/my_tree.h | 15 +++++++++------ include/myisam.h | 1 + 3 files changed, 13 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/my_base.h b/include/my_base.h index aee9f7af3f1..7e63b72c934 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -91,7 +91,9 @@ enum ha_extra_function { HA_EXTRA_RESET_STATE, /* Reset positions */ HA_EXTRA_IGNORE_DUP_KEY, /* Dup keys don't rollback everything*/ HA_EXTRA_NO_IGNORE_DUP_KEY, - HA_EXTRA_DONT_USE_CURSOR_TO_UPDATE /* Cursor will not be used for update */ + HA_EXTRA_DONT_USE_CURSOR_TO_UPDATE, /* Cursor will not be used for update */ + HA_EXTRA_BULK_INSERT_BEGIN, + HA_EXTRA_BULK_INSERT_END }; /* The following is parameter to ha_panic() */ diff --git a/include/my_tree.h b/include/my_tree.h index be95e3ff4d2..d3adbe17e6f 100644 --- a/include/my_tree.h +++ b/include/my_tree.h @@ -32,6 +32,9 @@ typedef enum { left_root_right, right_root_left } TREE_WALK; typedef uint32 element_count; typedef int (*tree_walk_action)(void *,element_count,void *); +typedef enum { free_init, free_free, free_end } TREE_FREE; +typedef void (*tree_element_free)(void*, TREE_FREE, void *); + #ifdef MSDOS typedef struct st_tree_element { struct st_tree_element *left,*right; @@ -49,18 +52,18 @@ typedef struct st_tree_element { typedef struct st_tree { TREE_ELEMENT *root,null_element; TREE_ELEMENT **parents[MAX_TREE_HIGHT]; - uint offset_to_key,elements_in_tree,size_of_element; + uint offset_to_key,elements_in_tree,size_of_element,memory_limit,allocated; qsort_cmp2 compare; - void* cmp_arg; + void* custom_arg; MEM_ROOT mem_root; my_bool with_delete; - void (*free)(void *); + tree_element_free free; } TREE; /* Functions on whole tree */ -void init_tree(TREE *tree,uint default_alloc_size, int element_size, - qsort_cmp2 compare, my_bool with_delete, - void (*free_element)(void*)); +void init_tree(TREE *tree, uint default_alloc_size, uint memory_limit, + int size, qsort_cmp2 compare, my_bool with_delete, + tree_element_free free_element, void *custom_arg); void delete_tree(TREE*); void reset_tree(TREE*); /* similar to delete tree, except we do not my_free() blocks in mem_root diff --git a/include/myisam.h b/include/myisam.h index 34babba163c..ec141bb5912 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -190,6 +190,7 @@ extern uint myisam_block_size; extern my_bool myisam_flush,myisam_delay_key_write,myisam_single_user; extern my_bool myisam_concurrent_insert; extern my_off_t myisam_max_temp_length,myisam_max_extra_temp_length; +extern uint myisam_bulk_insert_tree_size; /* Prototypes for myisam-functions */ -- cgit v1.2.1