MySQL 8.3.0
Source Code Documentation
hash_join_buffer::HashJoinRowBuffer Class Reference

#include <hash_join_buffer.h>

Public Types

using hash_map_type = robin_hood::unordered_flat_map< ImmutableStringWithLength, LinkedImmutableString, KeyHasher, KeyEquals >
 
using hash_map_iterator = hash_map_type::const_iterator
 

Public Member Functions

 HashJoinRowBuffer (pack_rows::TableCollection tables, std::vector< HashJoinCondition > join_conditions, size_t max_mem_available_bytes)
 
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
 
bool inited () const
 
hash_map_iterator find (const Key &key) const
 
hash_map_iterator begin () const
 
hash_map_iterator end () 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< hash_map_typem_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}
 

Member Typedef Documentation

◆ hash_map_iterator

using hash_join_buffer::HashJoinRowBuffer::hash_map_iterator = hash_map_type::const_iterator

◆ hash_map_type

Constructor & Destructor Documentation

◆ HashJoinRowBuffer()

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

Member Function Documentation

◆ begin()

hash_map_iterator hash_join_buffer::HashJoinRowBuffer::begin ( void  ) const
inline

◆ contains()

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

◆ empty()

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

◆ end()

hash_map_iterator hash_join_buffer::HashJoinRowBuffer::end ( void  ) const
inline

◆ find()

hash_map_iterator hash_join_buffer::HashJoinRowBuffer::find ( const Key key) const
inline

◆ Init()

bool hash_join_buffer::HashJoinRowBuffer::Init ( void  )

◆ inited()

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

◆ 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
inline

◆ 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<hash_map_type> 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: