diff options
author | unknown <igor@rurik.mysql.com> | 2003-08-02 02:43:18 -0700 |
---|---|---|
committer | unknown <igor@rurik.mysql.com> | 2003-08-02 02:43:18 -0700 |
commit | b6d27e20e19e1998b745a438dbde635261ebc5d4 (patch) | |
tree | add5cbee3049a38799b03ee640b5ae06fbc34ef1 /include/my_sys.h | |
parent | 4f6f7f7ded18764b8aa382c3a84261657fea66f8 (diff) | |
download | mariadb-git-b6d27e20e19e1998b745a438dbde635261ebc5d4.tar.gz |
Many files:
Added key cache assignment
mi_locking.c:
Added key cache assignment: correction
my_sys.h:
Added key cache variable structure
include/my_sys.h:
Added key cache variable structure
include/my_base.h:
Added key cache assignment
include/myisam.h:
Added key cache assignment
include/my_global.h:
Added key cache assignment
isam/_page.c:
Added key cache assignment
isam/close.c:
Added key cache assignment
isam/isamchk.c:
Added key cache assignment
isam/isamlog.c:
Added key cache assignment
isam/panic.c:
Added key cache assignment
isam/_locking.c:
Added key cache assignment
isam/test2.c:
Added key cache assignment
isam/test3.c:
Added key cache assignment
myisam/myisamdef.h:
Added key cache assignment
myisam/mi_check.c:
Added key cache assignment
myisam/mi_close.c:
Added key cache assignment
myisam/mi_extra.c:
Added key cache assignment
myisam/mi_page.c:
Added key cache assignment
myisam/mi_panic.c:
Added key cache assignment
myisam/mi_preload.c:
Added key cache assignment
myisam/mi_test1.c:
Added key cache assignment
myisam/mi_test2.c:
Added key cache assignment
myisam/mi_test3.c:
Added key cache assignment
myisam/myisamchk.c:
Added key cache assignment
myisam/myisamlog.c:
Added key cache assignment
myisam/mi_delete_all.c:
Added key cache assignment
myisam/mi_locking.c:
Added key cache assignment: correction
myisam/mi_keycache.c:
Added key cache assignment
sql/handler.h:
Added key cache assignment
sql/mysql_priv.h:
Added key cache assignment
sql/set_var.h:
Added key cache assignment
sql/table.h:
Added key cache assignment
sql/ha_myisam.cc:
Added key cache assignment
sql/ha_myisammrg.cc:
Added key cache assignment
sql/handler.cc:
Added key cache assignment
sql/mysqld.cc:
Added key cache assignment
sql/set_var.cc:
Added key cache assignment
sql/sql_base.cc:
Added key cache assignment
sql/sql_table.cc:
Added key cache assignment
sql/sql_test.cc:
Added key cache assignment
sql/sql_yacc.yy:
Added key cache assignment
mysys/mf_keycache.c:
Added key cache assignment
mysql-test/t/key_cache.test:
Added key cache assignment
mysql-test/r/key_cache.result:
Added key cache assignment
Diffstat (limited to 'include/my_sys.h')
-rw-r--r-- | include/my_sys.h | 55 |
1 files changed, 39 insertions, 16 deletions
diff --git a/include/my_sys.h b/include/my_sys.h index dae7f3d4a11..c390171d890 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -111,8 +111,6 @@ extern int NEAR my_errno; /* Last error in mysys */ #define MY_WAIT_FOR_USER_TO_FIX_PANIC 60 /* in seconds */ #define MY_WAIT_GIVE_USER_A_MESSAGE 10 /* Every 10 times of prev */ #define MIN_COMPRESS_LENGTH 50 /* Don't compress small bl. */ -#define DEFAULT_KEYCACHE_BLOCK_SIZE 1024 -#define MAX_KEYCACHE_BLOCK_SIZE 16384 /* root_alloc flags */ #define MY_KEEP_PREALLOC 1 @@ -248,8 +246,6 @@ extern my_bool NEAR my_disable_locking,NEAR my_disable_async_io, extern char wild_many,wild_one,wild_prefix; extern const char *charsets_dir; extern char *defaults_extra_file; -extern void *dflt_keycache; -#define dflt_key_block_size DEFAULT_KEYCACHE_BLOCK_SIZE typedef struct wild_file_pack /* Struct to hold info when selecting files */ { @@ -503,11 +499,37 @@ my_off_t my_b_append_tell(IO_CACHE* info); #define my_b_bytes_in_cache(info) (uint) (*(info)->current_end - \ *(info)->current_pos) -/* key_cache_variables */ -typedef struct st_keycache +/* Pointer to a key cache data structure (see the key cache module) */ +typedef struct st_key_cache* KEY_CACHE_HANDLE; + +/* Key cache variable structure */ +/* + The structure contains the parameters of a key cache that can + be set and undated by regular set global statements. + It also contains read-only statistics parameters. + If the corresponding key cache data structure has been already + created the variable contains the key cache handle. + The variables are put into a named list called key_caches. + At present the variables are only added to this list. +*/ +typedef struct st_key_cache_var { - ulonglong size; -} KEY_CACHE; + ulonglong buff_size; /* size the memory allocated for the cache */ + ulong block_size; /* size of the blocks in the key cache */ + KEY_CACHE_HANDLE cache; /* handles for the current and registered */ + ulong blocks_used; /* number of currently used blocks */ + ulong blocks_changed; /* number of currently dirty blocks */ + ulong cache_w_requests; /* number of write requests (write hits) */ + ulong cache_write; /* number of writes from the cache to files */ + ulong cache_r_requests; /* number of read requests (read hits) */ + ulong cache_read; /* number of reads from files to the cache */ + int blocks; /* max number of blocks in the cache */ + struct st_key_cache_asmt *assign_list; /* list of assignments to the cache */ +} KEY_CACHE_VAR; + +#define DEFAULT_KEY_CACHE_NAME "default" +extern KEY_CACHE_HANDLE *dflt_keycache; +extern KEY_CACHE_VAR dflt_key_cache_var; #include <my_alloc.h> @@ -647,21 +669,22 @@ extern int flush_write_cache(RECORD_CACHE *info); extern long my_clock(void); extern sig_handler sigtstp_handler(int signal_number); extern void handle_recived_signals(void); -extern int init_key_cache(void **pkeycache,uint key_cache_block_size, - ulong use_mem); -extern int resize_key_cache(void **pkeycache,ulong use_mem); -extern byte *key_cache_read(void *pkeycache, +extern int init_key_cache(KEY_CACHE_HANDLE *pkeycache, + uint key_cache_block_sie, + ulong use_mem, KEY_CACHE_VAR* env); +extern int resize_key_cache(KEY_CACHE_HANDLE *pkeycache, ulong use_mem); +extern byte *key_cache_read(KEY_CACHE_HANDLE keycache, File file,my_off_t filepos,byte* buff,uint length, uint block_length,int return_buffer); -extern int key_cache_insert(void *pkeycache, +extern int key_cache_insert(KEY_CACHE_HANDLE keycache, File file, my_off_t filepos, byte *buff, uint length); -extern int key_cache_write(void *pkeycache, +extern int key_cache_write(KEY_CACHE_HANDLE keycache, File file,my_off_t filepos,byte* buff,uint length, uint block_length,int force_write); -extern int flush_key_blocks(void *pkeycache, +extern int flush_key_blocks(KEY_CACHE_HANDLE keycache, int file, enum flush_type type); -extern void end_key_cache(void **pkeycache,my_bool cleanup); +extern void end_key_cache(KEY_CACHE_HANDLE *pkeycache,my_bool cleanup); extern sig_handler my_set_alarm_variable(int signo); extern void my_string_ptr_sort(void *base,uint items,size_s size); extern void radixsort_for_str_ptr(uchar* base[], uint number_of_elements, |