mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
c21eaa3085
Applied innodb-4.1-ss20 snapshot.
67 lines
1.6 KiB
Text
67 lines
1.6 KiB
Text
/************************************************************************
|
|
The index tree adaptive search
|
|
|
|
(c) 1996 Innobase Oy
|
|
|
|
Created 2/17/1996 Heikki Tuuri
|
|
*************************************************************************/
|
|
|
|
#include "dict0mem.h"
|
|
#include "btr0cur.h"
|
|
#include "buf0buf.h"
|
|
|
|
/*************************************************************************
|
|
Updates the search info. */
|
|
|
|
void
|
|
btr_search_info_update_slow(
|
|
/*========================*/
|
|
btr_search_t* info, /* in/out: search info */
|
|
btr_cur_t* cursor);/* in: cursor which was just positioned */
|
|
|
|
/************************************************************************
|
|
Returns search info for an index. */
|
|
UNIV_INLINE
|
|
btr_search_t*
|
|
btr_search_get_info(
|
|
/*================*/
|
|
/* out: search info; search mutex reserved */
|
|
dict_index_t* index) /* in: index */
|
|
{
|
|
ut_ad(index);
|
|
|
|
return(index->search_info);
|
|
}
|
|
|
|
/*************************************************************************
|
|
Updates the search info. */
|
|
UNIV_INLINE
|
|
void
|
|
btr_search_info_update(
|
|
/*===================*/
|
|
dict_index_t* index, /* in: index of the cursor */
|
|
btr_cur_t* cursor) /* in: cursor which was just positioned */
|
|
{
|
|
btr_search_t* info;
|
|
|
|
#ifdef UNIV_SYNC_DEBUG
|
|
ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_SHARED));
|
|
ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_EX));
|
|
#endif /* UNIV_SYNC_DEBUG */
|
|
|
|
info = btr_search_get_info(index);
|
|
|
|
info->hash_analysis++;
|
|
|
|
if (info->hash_analysis < BTR_SEARCH_HASH_ANALYSIS) {
|
|
|
|
/* Do nothing */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
ut_ad(cursor->flag != BTR_CUR_HASH);
|
|
|
|
btr_search_info_update_slow(info, cursor);
|
|
}
|