1#ifndef SQL_ITERATORS_HASH_JOIN_BUFFER_H_
2#define SQL_ITERATORS_HASH_JOIN_BUFFER_H_
102using Key = std::string_view;
124 std::vector<HashJoinCondition> join_conditions,
125 size_t max_mem_available_bytes);
153 std::optional<LinkedImmutableString>
find(
Key key)
const;
155 std::optional<LinkedImmutableString>
first_row()
const;
A class that represents a join condition in a hash join.
Definition: item_cmpfunc.h:87
LinkedImmutableString is designed for storing rows (values) in hash join.
Definition: immutable_string.h:173
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:168
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
Definition: hash_join_buffer.h:119
String m_buffer
Definition: hash_join_buffer.h:193
bool contains(const Key &key) const
Definition: hash_join_buffer.h:164
size_t m_row_size_upper_bound
Definition: hash_join_buffer.h:194
std::unique_ptr< HashMap > m_hash_map
Definition: hash_join_buffer.h:189
std::optional< LinkedImmutableString > first_row() const
Definition: hash_join_buffer.cc:328
size_t size() const
Definition: hash_join_buffer.cc:320
bool Init()
Definition: hash_join_buffer.cc:184
bool Initialized() const
Definition: hash_join_buffer.h:162
bool empty() const
Definition: hash_join_buffer.h:151
HashJoinRowBuffer(pack_rows::TableCollection tables, std::vector< HashJoinCondition > join_conditions, size_t max_mem_available_bytes)
Definition: hash_join_buffer.cc:166
std::optional< LinkedImmutableString > find(Key key) const
Definition: hash_join_buffer.cc:322
LinkedImmutableString m_last_row_stored
Definition: hash_join_buffer.h:205
const std::vector< HashJoinCondition > m_join_conditions
Definition: hash_join_buffer.h:168
const size_t m_max_mem_available
Definition: hash_join_buffer.h:197
LinkedImmutableString StoreLinkedImmutableStringFromTableBuffers(LinkedImmutableString next_ptr, bool *full)
Definition: hash_join_buffer.cc:109
StoreRowResult StoreRow(THD *thd, bool reject_duplicate_keys)
Store the row that is currently lying in the tables record buffers.
Definition: hash_join_buffer.cc:212
const pack_rows::TableCollection m_tables
Definition: hash_join_buffer.h:174
LinkedImmutableString LastRowStored() const
Definition: hash_join_buffer.h:157
MEM_ROOT m_overflow_mem_root
Definition: hash_join_buffer.h:186
MEM_ROOT m_mem_root
Definition: hash_join_buffer.h:178
A structure that contains a list of input tables for a hash join operation, BKA join operation or a s...
Definition: pack_rows.h:93
ImmutableString defines a storage format for strings that is designed to be as compact as possible,...
This file follows Google coding style, except for the name MEM_ROOT (which is kept for historical rea...
Definition: hash_join_buffer.cc:47
std::string_view Key
The key type for the hash structure in HashJoinRowBuffer.
Definition: hash_join_buffer.h:102
Key BufferRow
Definition: hash_join_buffer.h:105
void LoadImmutableStringIntoTableBuffers(const TableCollection &tables, LinkedImmutableString row)
Definition: hash_join_buffer.cc:161
void LoadBufferRowIntoTableBuffers(const TableCollection &tables, BufferRow row)
Definition: hash_join_buffer.cc:154
StoreRowResult
Definition: hash_join_buffer.h:117
Generic routines for packing rows (possibly from multiple tables at the same time) into strings,...
required string key
Definition: replication_asynchronous_connection_failover.proto:60
Our own string classes, used pervasively throughout the executor.
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83