1
/*****************************************************************************
3
Copyright (C) 1996, 2009, Innobase Oy. All Rights Reserved.
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.
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.
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
17
*****************************************************************************/
19
/********************************************************************//**
20
@file include/btr0sea.ic
21
The index tree adaptive search
23
Created 2/17/1996 Heikki Tuuri
24
*************************************************************************/
30
/*********************************************************************//**
31
Updates the search info. */
34
btr_search_info_update_slow(
35
/*========================*/
36
btr_search_t* info, /*!< in/out: search info */
37
btr_cur_t* cursor);/*!< in: cursor which was just positioned */
39
/********************************************************************//**
40
Returns search info for an index.
41
@return search info; search mutex reserved */
46
dict_index_t* index) /*!< in: index */
50
return(index->search_info);
53
/*********************************************************************//**
54
Updates the search info. */
57
btr_search_info_update(
58
/*===================*/
59
dict_index_t* index, /*!< in: index of the cursor */
60
btr_cur_t* cursor) /*!< in: cursor which was just positioned */
64
#ifdef UNIV_SYNC_DEBUG
65
ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_SHARED));
66
ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_EX));
67
#endif /* UNIV_SYNC_DEBUG */
69
info = btr_search_get_info(index);
71
info->hash_analysis++;
73
if (info->hash_analysis < BTR_SEARCH_HASH_ANALYSIS) {
81
ut_ad(cursor->flag != BTR_CUR_HASH);
83
btr_search_info_update_slow(info, cursor);