drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
btr0sea.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (C) 1996, 2009, Innobase Oy. All Rights Reserved.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License as published by the Free Software
7Foundation; version 2 of the License.
8
9This program is distributed in the hope that it will be useful, but WITHOUT
10ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13You should have received a copy of the GNU General Public License along with
14this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15St, Fifth Floor, Boston, MA 02110-1301 USA
16
17*****************************************************************************/
18
19/********************************************************************/
25
26#pragma once
27#ifndef btr0sea_h
28#define btr0sea_h
29
30#include "univ.i"
31
32#include "rem0rec.h"
33#include "dict0dict.h"
34#include "btr0types.h"
35#include "mtr0mtr.h"
36#include "ha0ha.h"
37
38/*****************************************************************/
40UNIV_INTERN
41void
43/*==================*/
44 ulint hash_size);
45/*****************************************************************/
47UNIV_INTERN
48void
50/*=====================*/
51
52/********************************************************************/
54UNIV_INTERN
55void
57/*====================*/
58/********************************************************************/
60UNIV_INTERN
61void
63/*====================*/
64
65/********************************************************************/
68UNIV_INLINE
71/*================*/
72 dict_index_t* index);
73/*****************************************************************/
76UNIV_INTERN
79/*===================*/
80 mem_heap_t* heap);
81/*****************************************************************/
85UNIV_INTERN
86ulint
88/*==========================*/
89 btr_search_t* info);
90/*********************************************************************/
92UNIV_INLINE
93void
95/*===================*/
96 dict_index_t* index,
97 btr_cur_t* cursor);
98/******************************************************************/
104UNIV_INTERN
105ibool
107/*=====================*/
108 dict_index_t* index,
109 btr_search_t* info,
110 const dtuple_t* tuple,
111 ulint mode,
112 ulint latch_mode,
113 btr_cur_t* cursor,
114 ulint has_search_latch,
117 mtr_t* mtr);
118/********************************************************************/
123UNIV_INTERN
124void
126/*===================================*/
127 buf_block_t* new_block,
129 buf_block_t* block,
133 dict_index_t* index);
134/********************************************************************/
136UNIV_INTERN
137void
139/*============================*/
140 buf_block_t* block);
144/********************************************************************/
147UNIV_INTERN
148void
150/*=================================*/
151 ulint space,
152 ulint zip_size,
154 ulint page_no);
155/********************************************************************/
157UNIV_INTERN
158void
160/*==================================*/
161 btr_cur_t* cursor);
165/********************************************************************/
167UNIV_INTERN
168void
170/*=============================*/
171 btr_cur_t* cursor);
175/********************************************************************/
177UNIV_INTERN
178void
180/*=============================*/
181 btr_cur_t* cursor);
184#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
185/********************************************************************/
188UNIV_INTERN
189ibool
190btr_search_validate(void);
191/*======================*/
192#else
193# define btr_search_validate() TRUE
194#endif /* defined UNIV_AHI_DEBUG || defined UNIV_DEBUG */
195
198extern bool btr_search_enabled;
199
204extern ibool btr_search_fully_disabled;
205
208 ulint ref_count;
214
215 /* @{ The following fields are not protected by any latch.
216 Unfortunately, this means that they must be aligned to
217 the machine word, i.e., they cannot be turned into bit-fields. */
234 /* @} */
235 /*---------------------- @{ */
236 ulint n_fields;
238 ulint n_bytes;
241 ibool left_side;
245 /*---------------------- @} */
246#ifdef UNIV_SEARCH_PERF_STAT
247 ulint n_hash_succ;
249 ulint n_hash_fail;
250 ulint n_patt_succ;
252 ulint n_searches;
253#endif /* UNIV_SEARCH_PERF_STAT */
254#ifdef UNIV_DEBUG
255 ulint magic_n;
257# define BTR_SEARCH_MAGIC_N 1112765
258#endif /* UNIV_DEBUG */
259};
260
263
266 hash_table_t* hash_index;
269};
270
272extern btr_search_sys_t* btr_search_sys;
273
287extern rw_lock_t* btr_search_latch_temp;
288
290#define btr_search_latch (*btr_search_latch_temp)
291
292#ifdef UNIV_SEARCH_PERF_STAT
294extern ulint btr_search_n_succ;
296extern ulint btr_search_n_hash_fail;
297#endif /* UNIV_SEARCH_PERF_STAT */
298
302#define BTR_SEARCH_HASH_ANALYSIS 17
303
306#define BTR_SEARCH_ON_PATTERN_LIMIT 3
307
310#define BTR_SEARCH_ON_HASH_LIMIT 3
311
315#define BTR_SEA_TIMEOUT 10000
316
317#ifndef UNIV_NONINL
318#include "btr0sea.ic"
319#endif
320
321#endif
UNIV_INTERN btr_search_t * btr_search_info_create(mem_heap_t *heap)
Definition btr0sea.cc:254
UNIV_INTERN void btr_search_enable(void)
Definition btr0sea.cc:236
UNIV_INLINE btr_search_t * btr_search_get_info(dict_index_t *index)
UNIV_INTERN void btr_search_update_hash_on_delete(btr_cur_t *cursor)
Definition btr0sea.cc:1494
UNIV_INLINE void btr_search_info_update(dict_index_t *index, btr_cur_t *cursor)
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)
Definition btr0sea.cc:815
UNIV_INTERN void btr_search_move_or_delete_hash_entries(buf_block_t *new_block, buf_block_t *block, dict_index_t *index)
Definition btr0sea.cc:1431
struct btr_search_sys_struct btr_search_sys_t
Definition btr0sea.h:262
UNIV_INTERN void btr_search_disable(void)
Definition btr0sea.cc:206
UNIV_INTERN void btr_search_update_hash_on_insert(btr_cur_t *cursor)
Definition btr0sea.cc:1597
UNIV_INTERN void btr_search_drop_page_hash_index(buf_block_t *block)
Definition btr0sea.cc:1020
UNIV_INTERN ulint btr_search_info_get_ref_count(btr_search_t *info)
Definition btr0sea.cc:296
UNIV_INTERN void btr_search_sys_free(void)
Definition btr0sea.cc:190
UNIV_INTERN void btr_search_update_hash_node_on_insert(btr_cur_t *cursor)
Definition btr0sea.cc:1546
UNIV_INTERN void btr_search_drop_page_hash_when_freed(ulint space, ulint zip_size, ulint page_no)
Definition btr0sea.cc:1188
UNIV_INTERN void btr_search_sys_create(ulint hash_size)
Definition btr0sea.cc:167
struct btr_search_struct btr_search_t
Definition btr0types.h:40
struct btr_cur_struct btr_cur_t
Definition btr0types.h:38
struct buf_block_struct buf_block_t
Definition buf0types.h:33
buf_block_t * root_guess
Definition btr0sea.h:218
ulint n_hash_potential
Definition btr0sea.h:229
ulint hash_analysis
Definition btr0sea.h:220
ibool last_hash_succ
Definition btr0sea.h:224
hash_table_t * hash_index
Definition btr0sea.h:266