MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 /*================*/
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 /*===================*/
97  btr_cur_t* cursor);
98 /******************************************************************/
104 UNIV_INTERN
105 ibool
107 /*=====================*/
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 #else
193 # define btr_search_validate() TRUE
194 #endif /* defined UNIV_AHI_DEBUG || defined UNIV_DEBUG */
195 
198  ulint ref_count;
205  /* @{ The following fields are not protected by any latch.
206  Unfortunately, this means that they must be aligned to
207  the machine word, i.e., they cannot be turned into bit-fields. */
219  ulint n_hash_potential;
224  /* @} */
225  /*---------------------- @{ */
226  ulint n_fields;
228  ulint n_bytes;
231  ibool left_side;
235  /*---------------------- @} */
236 #ifdef UNIV_SEARCH_PERF_STAT
237  ulint n_hash_succ;
239  ulint n_hash_fail;
240  ulint n_patt_succ;
242  ulint n_searches;
243 #endif /* UNIV_SEARCH_PERF_STAT */
244 #ifdef UNIV_DEBUG
245  ulint magic_n;
247 # define BTR_SEARCH_MAGIC_N 1112765
248 #endif /* UNIV_DEBUG */
249 };
250 
256 };
257 
260 
261 #ifdef UNIV_SEARCH_PERF_STAT
262 
263 extern ulint btr_search_n_succ;
265 extern ulint btr_search_n_hash_fail;
266 #endif /* UNIV_SEARCH_PERF_STAT */
267 
271 #define BTR_SEARCH_HASH_ANALYSIS 17
272 
275 #define BTR_SEARCH_ON_PATTERN_LIMIT 3
276 
279 #define BTR_SEARCH_ON_HASH_LIMIT 3
280 
284 #define BTR_SEA_TIMEOUT 10000
285 
286 #ifndef UNIV_NONINL
287 #include "btr0sea.ic"
288 #endif
289 
290 #endif