MySQL 5.6.14 Source Code Document
|
#include "univ.i"
#include "rem0rec.h"
#include "dict0dict.h"
#include "btr0types.h"
#include "mtr0mtr.h"
#include "ha0ha.h"
#include "btr0sea.ic"
Go to the source code of this file.
Classes | |
struct | btr_search_t |
struct | btr_search_sys_t |
Macros | |
#define | btr_search_validate() TRUE |
#define | BTR_SEARCH_HASH_ANALYSIS 17 |
#define | BTR_SEARCH_ON_PATTERN_LIMIT 3 |
#define | BTR_SEARCH_ON_HASH_LIMIT 3 |
#define | BTR_SEA_TIMEOUT 10000 |
Variables | |
btr_search_sys_t * | btr_search_sys |
#define BTR_SEA_TIMEOUT 10000 |
#define BTR_SEARCH_HASH_ANALYSIS 17 |
#define BTR_SEARCH_ON_HASH_LIMIT 3 |
#define BTR_SEARCH_ON_PATTERN_LIMIT 3 |
UNIV_INTERN void btr_search_disable | ( | void | ) |
Disable the adaptive hash search system and empty the index.
Definition at line 228 of file btr0sea.cc.
UNIV_INTERN void btr_search_drop_page_hash_index | ( | buf_block_t * | block | ) |
Drops a page hash index. in: block containing index page, s- or x-latched, or an index page for which we know that block->buf_fix_count == 0
Drops a page hash index.
block | in: block containing index page, s- or x-latched, or an index page for which we know that block->buf_fix_count == 0 or it is an index page which has already been removed from the buf_pool->page_hash i.e.: it is in state BUF_BLOCK_REMOVE_HASH |
Definition at line 1053 of file btr0sea.cc.
UNIV_INTERN void btr_search_drop_page_hash_when_freed | ( | ulint | space, |
ulint | zip_size, | ||
ulint | page_no | ||
) |
Drops a possible page hash index when a page is evicted from the buffer pool or freed in a file segment. in: page number
Drops a possible page hash index when a page is evicted from the buffer pool or freed in a file segment.
space | in: space id |
zip_size | in: compressed page size in bytes or 0 for uncompressed pages |
page_no | in: page number |
Definition at line 1258 of file btr0sea.cc.
UNIV_INTERN void btr_search_enable | ( | void | ) |
Enable the adaptive hash search system.
Definition at line 268 of file btr0sea.cc.
UNIV_INLINE btr_search_t* btr_search_get_info | ( | dict_index_t * | index | ) |
Returns search info for an index.
index | in: index |
UNIV_INTERN ibool btr_search_guess_on_hash | ( | dict_index_t * | index, |
btr_search_t * | info, | ||
const dtuple_t * | tuple, | ||
ulint | mode, | ||
ulint | latch_mode, | ||
btr_cur_t * | cursor, | ||
ulint | has_search_latch, | ||
mtr_t * | mtr | ||
) |
Tries to guess the right search position based on the hash search info of the index. Note that if mode is PAGE_CUR_LE, which is used in inserts, and the function returns TRUE, then cursor->up_match and cursor->low_match both have sensible values.
Tries to guess the right search position based on the hash search info of the index. Note that if mode is PAGE_CUR_LE, which is used in inserts, and the function returns TRUE, then cursor->up_match and cursor->low_match both have sensible values.
index | in: index |
info | in: index search info |
tuple | in: logical record |
mode | in: PAGE_CUR_L, ... |
latch_mode | in: BTR_SEARCH_LEAF, ...; NOTE that only if has_search_latch is 0, we will have a latch set on the cursor page, otherwise we assume the caller uses his search latch to protect the record! |
cursor | out: tree cursor |
has_search_latch | in: latch mode the caller currently has on btr_search_latch: RW_S_LATCH, RW_X_LATCH, or 0 |
mtr | in: mtr |
Definition at line 847 of file btr0sea.cc.
UNIV_INTERN btr_search_t* btr_search_info_create | ( | mem_heap_t * | heap | ) |
Creates and initializes a search info struct.
Creates and initializes a search info struct.
heap | in: heap where created |
Definition at line 283 of file btr0sea.cc.
UNIV_INTERN ulint btr_search_info_get_ref_count | ( | btr_search_t * | info | ) |
Returns the value of ref_count. The value is protected by btr_search_latch.
Returns the value of ref_count. The value is protected by btr_search_latch.
info | in: search info. |
Definition at line 325 of file btr0sea.cc.
UNIV_INLINE void btr_search_info_update | ( | dict_index_t * | index, |
btr_cur_t * | cursor | ||
) |
Updates the search info. in: cursor which was just positioned
index | in: index of the cursor |
UNIV_INTERN void btr_search_move_or_delete_hash_entries | ( | buf_block_t * | new_block, |
buf_block_t * | block, | ||
dict_index_t * | index | ||
) |
Moves or deletes hash entries for moved records. If new_page is already hashed, then the hash index for page, if any, is dropped. If new_page is not hashed, and page is hashed, then a new hash index is built to new_page with the same parameters as page (this often happens when a page is split). in: record descriptor
Moves or deletes hash entries for moved records. If new_page is already hashed, then the hash index for page, if any, is dropped. If new_page is not hashed, and page is hashed, then a new hash index is built to new_page with the same parameters as page (this often happens when a page is split).
new_block | in: records are copied to this page |
block | in: index page from which records were copied, and the copied records will be deleted from this page |
index | in: record descriptor |
Definition at line 1497 of file btr0sea.cc.
UNIV_INTERN void btr_search_sys_create | ( | ulint | hash_size | ) |
Creates and initializes the adaptive search system at a database start. in: hash index hash table size
Creates and initializes the adaptive search system at a database start.
hash_size | in: hash index hash table size |
Definition at line 163 of file btr0sea.cc.
UNIV_INTERN void btr_search_sys_free | ( | void | ) |
Frees the adaptive search system at a database shutdown.
Definition at line 190 of file btr0sea.cc.
UNIV_INTERN void btr_search_update_hash_node_on_insert | ( | btr_cur_t * | cursor | ) |
Updates the page hash index when a single record is inserted on a page. in: cursor which was positioned to the place to insert using btr_cur_search_..., and the new record has been inserted next to the cursor
Updates the page hash index when a single record is inserted on a page.
cursor | in: cursor which was positioned to the place to insert using btr_cur_search_..., and the new record has been inserted next to the cursor |
Definition at line 1624 of file btr0sea.cc.
UNIV_INTERN void btr_search_update_hash_on_delete | ( | btr_cur_t * | cursor | ) |
Updates the page hash index when a single record is deleted from a page. in: cursor which was positioned on the record to delete using btr_cur_search_..., the record is not yet deleted
Updates the page hash index when a single record is deleted from a page.
cursor | in: cursor which was positioned on the record to delete using btr_cur_search_..., the record is not yet deleted |
Definition at line 1561 of file btr0sea.cc.
UNIV_INTERN void btr_search_update_hash_on_insert | ( | btr_cur_t * | cursor | ) |
Updates the page hash index when a single record is inserted on a page. in: cursor which was positioned to the place to insert using btr_cur_search_..., and the new record has been inserted next to the cursor
Updates the page hash index when a single record is inserted on a page.
cursor | in: cursor which was positioned to the place to insert using btr_cur_search_..., and the new record has been inserted next to the cursor |
Definition at line 1689 of file btr0sea.cc.
btr_search_sys_t* btr_search_sys |
The adaptive hash index
Definition at line 80 of file btr0sea.cc.