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_tree.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'include/my_tree.h') 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 -- cgit v1.2.1