40 #define CHANGED_BLOCKS_HASH 128
49 my_bool key_cache_inited;
51 my_bool resize_in_flush;
53 size_t key_cache_mem_size;
54 uint key_cache_block_size;
55 ulong min_warm_blocks;
57 ulonglong keycache_time;
66 ulong cnt_for_resize_op;
67 long blocks_available;
85 BLOCK_LINK *changed_blocks[CHANGED_BLOCKS_HASH];
93 ulonglong param_buff_size;
94 ulonglong param_block_size;
95 ulonglong param_division_limit;
96 ulonglong param_age_threshold;
99 ulong global_blocks_changed;
100 ulonglong global_cache_w_requests;
101 ulonglong global_cache_write;
102 ulonglong global_cache_r_requests;
103 ulonglong global_cache_read;
110 extern KEY_CACHE dflt_key_cache_var, *dflt_key_cache;
112 extern int init_key_cache(
KEY_CACHE *keycache, uint key_cache_block_size,
113 size_t use_mem, uint division_limit,
115 extern int resize_key_cache(
KEY_CACHE *keycache, uint key_cache_block_size,
116 size_t use_mem, uint division_limit,
118 extern void change_key_cache_param(
KEY_CACHE *keycache, uint division_limit,
120 extern uchar *key_cache_read(
KEY_CACHE *keycache,
122 uchar *buff, uint length,
123 uint block_length,
int return_buffer);
124 extern int key_cache_insert(
KEY_CACHE *keycache,
126 uchar *buff, uint length);
127 extern int key_cache_write(
KEY_CACHE *keycache,
129 uchar *buff, uint length,
130 uint block_length,
int force_write);
131 extern int flush_key_blocks(
KEY_CACHE *keycache,
133 extern void end_key_cache(
KEY_CACHE *keycache, my_bool cleanup);
136 extern my_bool multi_keycache_init(
void);
137 extern void multi_keycache_free(
void);
138 extern KEY_CACHE *multi_key_cache_search(uchar *key, uint length);
139 extern my_bool multi_key_cache_set(
const uchar *key, uint length,
141 extern void multi_key_cache_change(
KEY_CACHE *old_data,
143 extern int reset_key_cache_counters(
const char *
name,