diff options
author | unknown <ingo@mysql.com> | 2004-05-03 15:55:21 +0200 |
---|---|---|
committer | unknown <ingo@mysql.com> | 2004-05-03 15:55:21 +0200 |
commit | b482283cf732074ea3c9f3005f0b5140dbbdbbfe (patch) | |
tree | f82a460f807cff5eea040e4950e8f7b334c28f33 /include/keycache.h | |
parent | c5daed7c89c3adfc173127881601a7b5490a6445 (diff) | |
download | mariadb-git-b482283cf732074ea3c9f3005f0b5140dbbdbbfe.tar.gz |
WL#1700 - Properly count key_blocks_used and key_blocks_current.
Introduced a new free blocks list. Free blocks are now re-used before
new blocks are allocated from the pool. There is a new status variable
which can be queried by "show status like key_blocks_unused".
include/keycache.h:
WL#1700 - Properly count key_blocks_used and key_blocks_current.
free_block_list is the new free blocks list. It is implemented like a stack (LIFO).
blocks_unused holds the number of never used blocks plus the number of blocks in the free list.
Removed the variable global_blocks_used, as it was always the same as blocks_used.
mysql-test/r/key_cache.result:
WL#1700 - Properly count key_blocks_used and key_blocks_current.
Inserted some commands which show how key_blocks_used and key_blocks_unused work.
mysql-test/t/key_cache.test:
WL#1700 - Properly count key_blocks_used and key_blocks_current.
Inserted some commands which show how key_blocks_used and key_blocks_unused work.
mysys/mf_keycache.c:
WL#1700 - Properly count key_blocks_used and key_blocks_current.
Introduced a new free blocks list. The introductory comment says it all (I hope).
Removed the variable global_blocks_used, as it was always the same as blocks_used.
sql/mysqld.cc:
WL#1700 - Properly count key_blocks_used and key_blocks_current.
The blocks_unused count can be queried by "show status like key_blocks_unused".
Removed the variable global_blocks_used, as it was always the same as blocks_used.
Introduced SHOW_KEY_CACHE_CONST_LONG for status variables that
must not be modified (i.e. flushed to zero).
sql/sql_show.cc:
WL#1700 - Properly count key_blocks_used and key_blocks_current.
Introduced SHOW_KEY_CACHE_CONST_LONG for status variables that
must not be modified (i.e. flushed to zero).
sql/sql_test.cc:
WL#1700 - Properly count key_blocks_used and key_blocks_current.
Removed the variable global_blocks_used, as it was always the same as blocks_used.
sql/structs.h:
WL#1700 - Properly count key_blocks_used and key_blocks_current.
Introduced SHOW_KEY_CACHE_CONST_LONG for status variables that
must not be modified (i.e. flushed to zero).
Diffstat (limited to 'include/keycache.h')
-rw-r--r-- | include/keycache.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/keycache.h b/include/keycache.h index b882f3127f5..26ee0ccadb1 100644 --- a/include/keycache.h +++ b/include/keycache.h @@ -57,7 +57,8 @@ typedef struct st_key_cache int hash_links; /* max number of hash links */ int hash_links_used; /* number of hash links currently used */ int disk_blocks; /* max number of blocks in the cache */ - ulong blocks_used; /* number of currently used blocks */ + ulong blocks_used; /* maximum number of concurrently used blocks */ + ulong blocks_unused; /* number of currently unused blocks */ ulong blocks_changed; /* number of currently dirty blocks */ ulong warm_blocks; /* number of blocks in warm sub-chain */ ulong cnt_for_resize_op; /* counter to block resize operation */ @@ -65,6 +66,7 @@ typedef struct st_key_cache HASH_LINK **hash_root; /* arr. of entries into hash table buckets */ HASH_LINK *hash_link_root; /* memory for hash table links */ HASH_LINK *free_hash_list; /* list of free hash links */ + BLOCK_LINK *free_block_list; /* list of free blocks */ BLOCK_LINK *block_root; /* memory for block links */ byte HUGE_PTR *block_mem; /* memory for block buffers */ BLOCK_LINK *used_last; /* ptr to the last block of the LRU chain */ @@ -87,7 +89,6 @@ typedef struct st_key_cache ulong param_age_threshold; /* determines when hot block is downgraded */ /* Statistics variables */ - ulong global_blocks_used; /* number of currently used blocks */ ulong global_blocks_changed; /* number of currently dirty blocks */ ulong global_cache_w_requests;/* number of write requests (write hits) */ ulong global_cache_write; /* number of writes from the cache to files */ |