Class BaselineJoinHashTable

class BaselineJoinHashTable : public HashJoin

Public Functions

std::string toString(const ExecutorDeviceType device_type, const int device_id = 0, bool raw = false) const
std::set<DecodedJoinHashBufferEntry> toSet(const ExecutorDeviceType device_type, const int device_id) const
llvm::Value *codegenSlot(const CompilationOptions &co, const size_t index)
HashJoinMatchingSet codegenMatchingSet(const CompilationOptions &co, const size_t index)
int getInnerTableId() const
int getInnerTableRteIdx() const
HashType getHashType() const
Data_Namespace::MemoryLevel getMemoryLevel() const
int getDeviceCount() const
size_t offsetBufferOff() const
size_t countBufferOff() const
size_t payloadBufferOff() const
std::string getHashJoinType() const
virtual ~BaselineJoinHashTable()

Public Static Functions

std::shared_ptr<BaselineJoinHashTable> getInstance(const std::shared_ptr<Analyzer::BinOper> condition, const std::vector<InputTableInfo> &query_infos, const Data_Namespace::MemoryLevel memory_level, const JoinType join_type, const HashType preferred_hash_type, const int device_count, ColumnCacheMap &column_cache, Executor *executor, const HashTableBuildDagMap &hashtable_build_dag_map, const TableIdToNodeMap &table_id_to_node_map)

Make hash table from an in-flight SQL query’s parse tree etc.

size_t getShardCountForCondition(const Analyzer::BinOper *condition, const Executor *executor, const std::vector<InnerOuter> &inner_outer_pairs)
static void invalidateCache()
static void markCachedItemAsDirty(size_t table_key)
static HashtableRecycler *getHashTableCache()
static HashingSchemeRecycler *getHashingSchemeCache()

Protected Functions

BaselineJoinHashTable(const std::shared_ptr<Analyzer::BinOper> condition, const JoinType join_type, const std::vector<InputTableInfo> &query_infos, const Data_Namespace::MemoryLevel memory_level, ColumnCacheMap &column_cache, Executor *executor, const std::vector<InnerOuter> &inner_outer_pairs, const int device_count, HashtableAccessPathInfo hashtable_access_path_info, const TableIdToNodeMap &table_id_to_node_map)
size_t getComponentBufferSize() const
size_t getKeyBufferSize() const
void reifyWithLayout(const HashType layout)
ColumnsForDevice fetchColumnsForDevice(const std::vector<Fragmenter_Namespace::FragmentInfo> &fragments, const int device_id, DeviceAllocator *dev_buff_owner)
std::pair<size_t, size_t> approximateTupleCount(const std::vector<ColumnsForDevice> &columns_per_device, QueryPlanHash key, CacheItemType item_type, DeviceIdentifier device_identifier) const
size_t getKeyComponentWidth() const
size_t getKeyComponentCount() const
llvm::Value *codegenKey(const CompilationOptions &co)
size_t shardCount() const
Data_Namespace::MemoryLevel getEffectiveMemoryLevel(const std::vector<InnerOuter> &inner_outer_pairs) const
void reify(const HashType preferred_layout)
void reifyForDevice(const ColumnsForDevice &columns_for_device, const HashType layout, const int device_id, const size_t entry_count, const size_t emitted_keys_count, const logger::ThreadId parent_thread_id)
int initHashTableForDevice(const std::vector<JoinColumn> &join_columns, const std::vector<JoinColumnTypeInfo> &join_column_types, const std::vector<JoinBucketInfo> &join_buckets, const HashType layout, const Data_Namespace::MemoryLevel effective_memory_level, const size_t entry_count, const size_t emitted_keys_count, const int device_id)
llvm::Value *hashPtr(const size_t index)
std::shared_ptr<HashTable> initHashTableOnCpuFromCache(QueryPlanHash key, CacheItemType item_type, DeviceIdentifier device_identifier)
void putHashTableOnCpuToCache(QueryPlanHash key, CacheItemType item_type, std::shared_ptr<HashTable> hashtable_ptr, DeviceIdentifier device_identifier, size_t hashtable_building_time)
std::pair<std::optional<size_t>, size_t> getApproximateTupleCountFromCache(QueryPlanHash key, CacheItemType item_type, DeviceIdentifier device_identifier) const
bool isBitwiseEq() const

Protected Attributes

const std::shared_ptr<Analyzer::BinOper> condition_
const JoinType join_type_
const std::vector<InputTableInfo> &query_infos_
const Data_Namespace::MemoryLevel memory_level_
Executor *executor_
ColumnCacheMap &column_cache_
std::mutex cpu_hash_table_buff_mutex_
std::mutex str_proxy_translation_mutex_
std::vector<const StringDictionaryProxy::IdMap *> str_proxy_translation_maps_
std::vector<InnerOuter> inner_outer_pairs_
const Catalog_Namespace::Catalog *catalog_
const int device_count_
bool needs_dict_translation_
std::optional<HashType> layout_override_
QueryPlanHash hashtable_cache_key_
HashtableCacheMetaInfo hashtable_cache_meta_info_
std::unordered_set<size_t> table_keys_
const TableIdToNodeMap table_id_to_node_map_

Protected Static Functions

int getInnerTableId(const std::vector<InnerOuter> &inner_outer_pairs)
static QueryPlanHash getAlternativeCacheKey(AlternativeCacheKeyForBaselineHashJoin &info)

Protected Static Attributes

std::unique_ptr<HashtableRecycler> hash_table_cache_ = std::make_unique<HashtableRecycler>(CacheItemType::BASELINE_HT, )
std::unique_ptr<HashingSchemeRecycler> hash_table_layout_cache_ = std::make_unique<HashingSchemeRecycler>()
struct AlternativeCacheKeyForBaselineHashJoin

Public Members

std::vector<InnerOuter> inner_outer_pairs
const size_t num_elements
const SQLOps optype
const JoinType join_type