~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/btr0sea.ic

  • Committer: Brian Aker
  • Date: 2010-06-28 16:17:36 UTC
  • mfrom: (1637.4.1 drizzle)
  • Revision ID: brian@gaz-20100628161736-eormhb2mnd551i2h
Merge unused

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
/********************************************************************//**
20
 
@file include/btr0sea.ic
21
 
The index tree adaptive search
22
 
 
23
 
Created 2/17/1996 Heikki Tuuri
24
 
*************************************************************************/
25
 
 
26
 
#include "dict0mem.h"
27
 
#include "btr0cur.h"
28
 
#include "buf0buf.h"
29
 
 
30
 
/*********************************************************************//**
31
 
Updates the search info. */
32
 
UNIV_INTERN
33
 
void
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 */
38
 
 
39
 
/********************************************************************//**
40
 
Returns search info for an index.
41
 
@return search info; search mutex reserved */
42
 
UNIV_INLINE
43
 
btr_search_t*
44
 
btr_search_get_info(
45
 
/*================*/
46
 
        dict_index_t*   index)  /*!< in: index */
47
 
{
48
 
        ut_ad(index);
49
 
 
50
 
        return(index->search_info);
51
 
}
52
 
 
53
 
/*********************************************************************//**
54
 
Updates the search info. */
55
 
UNIV_INLINE
56
 
void
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 */
61
 
{
62
 
        btr_search_t*   info;
63
 
 
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 */
68
 
 
69
 
        info = btr_search_get_info(index);
70
 
 
71
 
        info->hash_analysis++;
72
 
 
73
 
        if (info->hash_analysis < BTR_SEARCH_HASH_ANALYSIS) {
74
 
 
75
 
                /* Do nothing */
76
 
 
77
 
                return;
78
 
 
79
 
        }
80
 
 
81
 
        ut_ad(cursor->flag != BTR_CUR_HASH);
82
 
 
83
 
        btr_search_info_update_slow(info, cursor);
84
 
}