InnoDB Plugin  1.0
btr0sea.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (c) 1996, 2011, Oracle and/or its affiliates. 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.,
15 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
16 
17 *****************************************************************************/
18 
19 /********************************************************************/
26 #ifndef btr0sea_h
27 #define btr0sea_h
28 
29 #include "univ.i"
30 
31 #include "rem0rec.h"
32 #include "dict0dict.h"
33 #include "btr0types.h"
34 #include "mtr0mtr.h"
35 #include "ha0ha.h"
36 
37 /*****************************************************************/
39 UNIV_INTERN
40 void
42 /*==================*/
43  ulint hash_size);
44 /*****************************************************************/
46 UNIV_INTERN
47 void
49 /*=====================*/
50 
51 /********************************************************************/
53 UNIV_INTERN
54 void
55 btr_search_disable(void);
56 /*====================*/
57 /********************************************************************/
59 UNIV_INTERN
60 void
61 btr_search_enable(void);
62 /*====================*/
63 
64 /********************************************************************/
67 UNIV_INLINE
70 /*================*/
71  dict_index_t* index)
72  __attribute__((nonnull));
73 /*****************************************************************/
76 UNIV_INTERN
79 /*===================*/
80  mem_heap_t* heap);
81 /*****************************************************************/
85 UNIV_INTERN
86 ulint
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
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
126 /*===================================*/
127  buf_block_t* new_block,
129  buf_block_t* block,
133  dict_index_t* index);
134 /********************************************************************/
136 UNIV_INTERN
137 void
139 /*============================*/
140  buf_block_t* block);
144 /********************************************************************/
147 UNIV_INTERN
148 void
150 /*=================================*/
151  ulint space,
152  ulint zip_size,
154  ulint page_no);
155 /********************************************************************/
157 UNIV_INTERN
158 void
160 /*==================================*/
161  btr_cur_t* cursor);
165 /********************************************************************/
167 UNIV_INTERN
168 void
170 /*=============================*/
171  btr_cur_t* cursor);
175 /********************************************************************/
177 UNIV_INTERN
178 void
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 #endif /* defined UNIV_AHI_DEBUG || defined UNIV_DEBUG */
193 
196  ulint ref_count;
203  /* @{ The following fields are not protected by any latch.
204  Unfortunately, this means that they must be aligned to
205  the machine word, i.e., they cannot be turned into bit-fields. */
217  ulint n_hash_potential;
222  /* @} */
223  /*---------------------- @{ */
224  ulint n_fields;
226  ulint n_bytes;
233  /*---------------------- @} */
234 #ifdef UNIV_SEARCH_PERF_STAT
235  ulint n_hash_succ;
237  ulint n_hash_fail;
238  ulint n_patt_succ;
240  ulint n_searches;
241 #endif /* UNIV_SEARCH_PERF_STAT */
242 #ifdef UNIV_DEBUG
243  ulint magic_n;
245 # define BTR_SEARCH_MAGIC_N 1112765
246 #endif /* UNIV_DEBUG */
247 };
248 
254 };
255 
258 
259 #ifdef UNIV_SEARCH_PERF_STAT
260 
261 extern ulint btr_search_n_succ;
263 extern ulint btr_search_n_hash_fail;
264 #endif /* UNIV_SEARCH_PERF_STAT */
265 
269 #define BTR_SEARCH_HASH_ANALYSIS 17
270 
273 #define BTR_SEARCH_ON_PATTERN_LIMIT 3
274 
277 #define BTR_SEARCH_ON_HASH_LIMIT 3
278 
282 #define BTR_SEA_TIMEOUT 10000
283 
284 #ifndef UNIV_NONINL
285 #include "btr0sea.ic"
286 #endif
287 
288 #endif