~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/include/btr0sea.h

  • Committer: Brian Aker
  • Date: 2008-11-04 15:39:09 UTC
  • mfrom: (575.1.2 devel)
  • Revision ID: brian@tangent.org-20081104153909-c72hn65udxs1ccal
Merge of Monty's work

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
/*********************************************************************
21
21
Creates and initializes the adaptive search system at a database start. */
22
 
 
 
22
UNIV_INTERN
23
23
void
24
24
btr_search_sys_create(
25
25
/*==================*/
26
26
        ulint   hash_size);     /* in: hash index hash table size */
 
27
 
 
28
/************************************************************************
 
29
Disable the adaptive hash search system and empty the index. */
 
30
UNIV_INTERN
 
31
void
 
32
btr_search_disable(void);
 
33
/*====================*/
 
34
/************************************************************************
 
35
Enable the adaptive hash search system. */
 
36
UNIV_INTERN
 
37
void
 
38
btr_search_enable(void);
 
39
/*====================*/
 
40
 
27
41
/************************************************************************
28
42
Returns search info for an index. */
29
43
UNIV_INLINE
34
48
        dict_index_t*   index); /* in: index */
35
49
/*********************************************************************
36
50
Creates and initializes a search info struct. */
37
 
 
 
51
UNIV_INTERN
38
52
btr_search_t*
39
53
btr_search_info_create(
40
54
/*===================*/
53
67
of the index. Note that if mode is PAGE_CUR_LE, which is used in inserts,
54
68
and the function returns TRUE, then cursor->up_match and cursor->low_match
55
69
both have sensible values. */
56
 
 
 
70
UNIV_INTERN
57
71
ibool
58
72
btr_search_guess_on_hash(
59
73
/*=====================*/
60
74
                                        /* out: TRUE if succeeded */
61
75
        dict_index_t*   index,          /* in: index */
62
76
        btr_search_t*   info,           /* in: index search info */
63
 
        dtuple_t*       tuple,          /* in: logical record */
 
77
        const dtuple_t* tuple,          /* in: logical record */
64
78
        ulint           mode,           /* in: PAGE_CUR_L, ... */
65
79
        ulint           latch_mode,     /* in: BTR_SEARCH_LEAF, ... */
66
80
        btr_cur_t*      cursor,         /* out: tree cursor */
73
87
then the hash index for page, if any, is dropped. If new_page is not hashed,
74
88
and page is hashed, then a new hash index is built to new_page with the same
75
89
parameters as page (this often happens when a page is split). */
76
 
 
 
90
UNIV_INTERN
77
91
void
78
92
btr_search_move_or_delete_hash_entries(
79
93
/*===================================*/
80
 
        page_t*         new_page,       /* in: records are copied
 
94
        buf_block_t*    new_block,      /* in: records are copied
81
95
                                        to this page */
82
 
        page_t*         page,           /* in: index page */
 
96
        buf_block_t*    block,          /* in: index page from which
 
97
                                        records were copied, and the
 
98
                                        copied records will be deleted
 
99
                                        from this page */
83
100
        dict_index_t*   index);         /* in: record descriptor */
84
101
/************************************************************************
85
102
Drops a page hash index. */
86
 
 
 
103
UNIV_INTERN
87
104
void
88
105
btr_search_drop_page_hash_index(
89
106
/*============================*/
90
 
        page_t* page);  /* in: index page, s- or x-latched */
 
107
        buf_block_t*    block); /* in: block containing index page,
 
108
                                s- or x-latched, or an index page
 
109
                                for which we know that
 
110
                                block->buf_fix_count == 0 */
91
111
/************************************************************************
92
112
Drops a page hash index when a page is freed from a fseg to the file system.
93
113
Drops possible hash index if the page happens to be in the buffer pool. */
94
 
 
 
114
UNIV_INTERN
95
115
void
96
116
btr_search_drop_page_hash_when_freed(
97
117
/*=================================*/
98
118
        ulint   space,          /* in: space id */
 
119
        ulint   zip_size,       /* in: compressed page size in bytes
 
120
                                or 0 for uncompressed pages */
99
121
        ulint   page_no);       /* in: page number */
100
122
/************************************************************************
101
123
Updates the page hash index when a single record is inserted on a page. */
102
 
 
 
124
UNIV_INTERN
103
125
void
104
126
btr_search_update_hash_node_on_insert(
105
127
/*==================================*/
109
131
                                to the cursor */
110
132
/************************************************************************
111
133
Updates the page hash index when a single record is inserted on a page. */
112
 
 
 
134
UNIV_INTERN
113
135
void
114
136
btr_search_update_hash_on_insert(
115
137
/*=============================*/
119
141
                                to the cursor */
120
142
/************************************************************************
121
143
Updates the page hash index when a single record is deleted from a page. */
122
 
 
 
144
UNIV_INTERN
123
145
void
124
146
btr_search_update_hash_on_delete(
125
147
/*=============================*/
128
150
                                the record is not yet deleted */
129
151
/************************************************************************
130
152
Validates the search system. */
131
 
 
 
153
UNIV_INTERN
132
154
ibool
133
155
btr_search_validate(void);
134
156
/*======================*/
135
157
                                /* out: TRUE if ok */
136
158
 
 
159
/* Flag: has the search system been disabled? */
 
160
extern ibool btr_search_disabled;
 
161
 
137
162
/* The search info struct in an index */
138
163
 
139
164
struct btr_search_struct{
140
165
        /* The following fields are not protected by any latch.
141
166
        Unfortunately, this means that they must be aligned to
142
167
        the machine word, i.e., they cannot be turned into bit-fields. */
143
 
        page_t* root_guess;     /* the root page frame when it was last time
 
168
        buf_block_t* root_guess;/* the root page frame when it was last time
144
169
                                fetched, or NULL */
145
170
        ulint   hash_analysis;  /* when this exceeds BTR_SEARCH_HASH_ANALYSIS,
146
171
                                the hash analysis starts; this is reset if no