Drizzled Public API Documentation

btr0sea.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (C) 1996, 2009, Innobase Oy. All Rights Reserved.
4 
5 This program is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free Software
7 Foundation; version 2 of the License.
8 
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12 
13 You should have received a copy of the GNU General Public License along with
14 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15 St, Fifth Floor, Boston, MA 02110-1301 USA
16 
17 *****************************************************************************/
18 
19 /********************************************************************/
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 /*****************************************************************/
40 UNIV_INTERN
41 void
42 btr_search_sys_create(
43 /*==================*/
44  ulint hash_size);
45 /*****************************************************************/
47 UNIV_INTERN
48 void
49 btr_search_sys_free(void);
50 /*=====================*/
51 
52 /********************************************************************/
54 UNIV_INTERN
55 void
56 btr_search_disable(void);
57 /*====================*/
58 /********************************************************************/
60 UNIV_INTERN
61 void
62 btr_search_enable(void);
63 /*====================*/
64 
65 /********************************************************************/
68 UNIV_INLINE
71 /*================*/
72  dict_index_t* index);
73 /*****************************************************************/
76 UNIV_INTERN
78 btr_search_info_create(
79 /*===================*/
80  mem_heap_t* heap);
81 /*****************************************************************/
85 UNIV_INTERN
86 ulint
87 btr_search_info_get_ref_count(
88 /*==========================*/
89  btr_search_t* info);
90 /*********************************************************************/
92 UNIV_INLINE
93 void
95 /*===================*/
96  dict_index_t* index,
97  btr_cur_t* cursor);
98 /******************************************************************/
104 UNIV_INTERN
105 ibool
106 btr_search_guess_on_hash(
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 /********************************************************************/
123 UNIV_INTERN
124 void
125 btr_search_move_or_delete_hash_entries(
126 /*===================================*/
127  buf_block_t* new_block,
129  buf_block_t* block,
133  dict_index_t* index);
134 /********************************************************************/
136 UNIV_INTERN
137 void
138 btr_search_drop_page_hash_index(
139 /*============================*/
140  buf_block_t* block);
144 /********************************************************************/
147 UNIV_INTERN
148 void
149 btr_search_drop_page_hash_when_freed(
150 /*=================================*/
151  ulint space,
152  ulint zip_size,
154  ulint page_no);
155 /********************************************************************/
157 UNIV_INTERN
158 void
159 btr_search_update_hash_node_on_insert(
160 /*==================================*/
161  btr_cur_t* cursor);
165 /********************************************************************/
167 UNIV_INTERN
168 void
169 btr_search_update_hash_on_insert(
170 /*=============================*/
171  btr_cur_t* cursor);
175 /********************************************************************/
177 UNIV_INTERN
178 void
179 btr_search_update_hash_on_delete(
180 /*=============================*/
181  btr_cur_t* cursor);
184 #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
185 /********************************************************************/
188 UNIV_INTERN
189 ibool
190 btr_search_validate(void);
191 /*======================*/
192 #else
193 # define btr_search_validate() TRUE
194 #endif /* defined UNIV_AHI_DEBUG || defined UNIV_DEBUG */
195 
198 extern bool btr_search_enabled;
199 
204 extern ibool btr_search_fully_disabled;
205 
208  ulint ref_count;
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 
269 };
270 
272 extern btr_search_sys_t* btr_search_sys;
273 
287 extern rw_lock_t* btr_search_latch_temp;
288 
290 #define btr_search_latch (*btr_search_latch_temp)
291 
292 #ifdef UNIV_SEARCH_PERF_STAT
293 
294 extern ulint btr_search_n_succ;
296 extern 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