MySQL 8.0.39
Source Code Documentation
hash_join_buffer::HashJoinRowBuffer Class Reference

#include <hash_join_buffer.h>

Classes

class  HashMap
 

Public Member Functions

 HashJoinRowBuffer (pack_rows::TableCollection tables, std::vector< HashJoinCondition > join_conditions, size_t max_mem_available_bytes)
 
 ~HashJoinRowBuffer ()
 
bool Init ()
 
StoreRowResult StoreRow (THD *thd, bool reject_duplicate_keys)
 Store the row that is currently lying in the tables record buffers. More...
 
size_t size () const
 
bool empty () const
 
std::optional< LinkedImmutableStringfind (Key key) const
 
std::optional< LinkedImmutableStringfirst_row () const
 
LinkedImmutableString LastRowStored () const
 
bool Initialized () const
 
bool contains (const Key &key) const
 

Private Member Functions

LinkedImmutableString StoreLinkedImmutableStringFromTableBuffers (LinkedImmutableString next_ptr, bool *full)
 

Private Attributes

const std::vector< HashJoinConditionm_join_conditions
 
const pack_rows::TableCollection m_tables
 
MEM_ROOT m_mem_root
 
MEM_ROOT m_overflow_mem_root
 
std::unique_ptr< HashMapm_hash_map
 
String m_buffer
 
size_t m_row_size_upper_bound
 
const size_t m_max_mem_available
 
LinkedImmutableString m_last_row_stored {nullptr}
 

Constructor & Destructor Documentation

◆ HashJoinRowBuffer()

hash_join_buffer::HashJoinRowBuffer::HashJoinRowBuffer ( pack_rows::TableCollection  tables,
std::vector< HashJoinCondition join_conditions,
size_t  max_mem_available_bytes 
)

◆ ~HashJoinRowBuffer()

hash_join_buffer::HashJoinRowBuffer::~HashJoinRowBuffer ( )
default

Member Function Documentation

◆ contains()

bool hash_join_buffer::HashJoinRowBuffer::contains ( const Key key) const
inline

◆ empty()

bool hash_join_buffer::HashJoinRowBuffer::empty ( ) const
inline

◆ find()

std::optional< LinkedImmutableString > hash_join_buffer::HashJoinRowBuffer::find ( Key  key) const

◆ first_row()

std::optional< LinkedImmutableString > hash_join_buffer::HashJoinRowBuffer::first_row ( ) const

◆ Init()

bool hash_join_buffer::HashJoinRowBuffer::Init ( void  )

◆ Initialized()

bool hash_join_buffer::HashJoinRowBuffer::Initialized ( ) const
inline

◆ LastRowStored()

LinkedImmutableString hash_join_buffer::HashJoinRowBuffer::LastRowStored ( ) const
inline

◆ size()

size_t hash_join_buffer::HashJoinRowBuffer::size ( ) const

◆ StoreLinkedImmutableStringFromTableBuffers()

LinkedImmutableString hash_join_buffer::HashJoinRowBuffer::StoreLinkedImmutableStringFromTableBuffers ( LinkedImmutableString  next_ptr,
bool *  full 
)
private

◆ StoreRow()

StoreRowResult hash_join_buffer::HashJoinRowBuffer::StoreRow ( THD thd,
bool  reject_duplicate_keys 
)

Store the row that is currently lying in the tables record buffers.

The hash map key is extracted from the join conditions that the row buffer holds.

Parameters
thdthe thread handler
reject_duplicate_keysIf true, reject rows with duplicate keys. If a row is rejected, the function will still return ROW_STORED.
Return values
ROW_STOREDthe row was stored.
BUFFER_FULLthe row was stored, and the buffer is full.
FATAL_ERRORan unrecoverable error occurred (most likely, malloc failed). It is the caller's responsibility to call my_error().

Member Data Documentation

◆ m_buffer

String hash_join_buffer::HashJoinRowBuffer::m_buffer
private

◆ m_hash_map

std::unique_ptr<HashMap> hash_join_buffer::HashJoinRowBuffer::m_hash_map
private

◆ m_join_conditions

const std::vector<HashJoinCondition> hash_join_buffer::HashJoinRowBuffer::m_join_conditions
private

◆ m_last_row_stored

LinkedImmutableString hash_join_buffer::HashJoinRowBuffer::m_last_row_stored {nullptr}
private

◆ m_max_mem_available

const size_t hash_join_buffer::HashJoinRowBuffer::m_max_mem_available
private

◆ m_mem_root

MEM_ROOT hash_join_buffer::HashJoinRowBuffer::m_mem_root
private

◆ m_overflow_mem_root

MEM_ROOT hash_join_buffer::HashJoinRowBuffer::m_overflow_mem_root
private

◆ m_row_size_upper_bound

size_t hash_join_buffer::HashJoinRowBuffer::m_row_size_upper_bound
private

◆ m_tables

const pack_rows::TableCollection hash_join_buffer::HashJoinRowBuffer::m_tables
private

The documentation for this class was generated from the following files: