MySQL 8.4.1
Source Code Documentation
buf_block_t::ahi_t Struct Reference

Structure that holds most AHI-related fields. More...

#include <buf0buf.h>

Public Member Functions

void validate () const
 
void assert_empty () const
 
void assert_empty_on_init () const
 

Public Attributes

std::atomic< btr_search_prefix_info_trecommended_prefix_info
 Recommended prefix info for hash search. More...
 
std::atomic< btr_search_prefix_info_tprefix_info
 Prefix info that was used for building hash index. More...
 
std::atomic< dict_index_t * > index
 Index for which the adaptive hash index has been created, or nullptr if the page does not exist in the index. More...
 
std::atomic< uint16_t > n_pointers
 Used in debugging. More...
 

Detailed Description

Structure that holds most AHI-related fields.

Member Function Documentation

◆ assert_empty()

void buf_block_t::ahi_t::assert_empty ( ) const
inline

◆ assert_empty_on_init()

void buf_block_t::ahi_t::assert_empty_on_init ( ) const
inline

◆ validate()

void buf_block_t::ahi_t::validate ( ) const
inline

Member Data Documentation

◆ index

std::atomic<dict_index_t *> buf_block_t::ahi_t::index

Index for which the adaptive hash index has been created, or nullptr if the page does not exist in the index.

Note that it does not guarantee that the AHI index is complete, though: there may have been hash collisions etc. It may be modified:

  • to nullptr if btr_search_enabled is false and block's mutex is held and block's state is BUF_BLOCK_FILE_PAGE and btr_search_enabled_mutex is owned, protecting the btr_search_enabled from being changed,
  • to nullptr if btr_search_enabled is false and block is held in private in BUF_BLOCK_REMOVE_HASH state in buf_LRU_free_page().
  • to any value under appropriate X-latch in btr_search_sys->parts[]->latch if btr_search_enabled is true (and setting btr_search_enabled to false in turn is protected by having all btr_search_sys->parts[]->latch X-latched).

◆ n_pointers

std::atomic<uint16_t> buf_block_t::ahi_t::n_pointers

Used in debugging.

The number of pointers in the adaptive hash index pointing to this frame; Modified under appropriate X-latch in btr_search_sys->parts[]->latch.

◆ prefix_info

std::atomic<btr_search_prefix_info_t> buf_block_t::ahi_t::prefix_info

Prefix info that was used for building hash index.

It cannot be modified while there are any record entries added in the AHI. It's invariant that all records added to AHI from this block were folded using this prefix info. It may only be modified when we are holding the appropriate X-latch in btr_search_sys->parts[]->latch. Also, it happens that it is modified to not-empty value only when the block is held in private or the block's lock is S- or X-latched. This implies that the field's non-empty value may be read and use reliably when the appropriate btr_search_sys->parts[]->latch S-latch or X-latch is being held, or the block's lock is X-latched.

◆ recommended_prefix_info

std::atomic<btr_search_prefix_info_t> buf_block_t::ahi_t::recommended_prefix_info

Recommended prefix info for hash search.

It is atomically copied from the index's current recommendation for the prefix info and should eventually get to the block's actual prefix info used. It is used to decide when the n_hash_helps should be reset. It is modified only while having S- or X- latch on block's lock.


The documentation for this struct was generated from the following file: