Class PerfectJoinHashTable

class PerfectJoinHashTable : 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 ~PerfectJoinHashTable()

Public Static Functions

std::shared_ptr<PerfectJoinHashTable> getInstance(const std::shared_ptr<Analyzer::BinOper> qual_bin_oper, 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.

static HashtableRecycler *getHashTableCache()
static HashingSchemeRecycler *getHashingSchemeCache()
static void invalidateCache()
static void markCachedItemAsDirty(size_t table_key)

Private Functions

bool isOneToOneHashPossible(const std::vector<ColumnsForDevice> &columns_per_device) const
ColumnsForDevice fetchColumnsForDevice(const std::vector<Fragmenter_Namespace::FragmentInfo> &fragments, const int device_id, DeviceAllocator *dev_buff_owner, const Catalog_Namespace::Catalog &catalog)
void reifyForDevice(const ChunkKey &hash_table_key, const ColumnsForDevice &columns_for_device, const HashType layout, const int device_id, const logger::ThreadId parent_thread_id)
int initHashTableForDevice(const ChunkKey &chunk_key, const JoinColumn &join_column, const InnerOuter &cols, const HashType layout, const Data_Namespace::MemoryLevel effective_memory_level, const int device_id)
Data_Namespace::MemoryLevel getEffectiveMemoryLevel(const std::vector<InnerOuter> &inner_outer_pairs) const
PerfectJoinHashTable(const std::shared_ptr<Analyzer::BinOper> qual_bin_oper, const Analyzer::ColumnVar *col_var, const std::vector<InputTableInfo> &query_infos, const Data_Namespace::MemoryLevel memory_level, const JoinType join_type, const HashType preferred_hash_type, const ExpressionRange &col_range, const ExpressionRange &rhs_source_col_range, ColumnCacheMap &column_cache, Executor *executor, const int device_count, HashtableAccessPathInfo hashtable_access_path_info, const TableIdToNodeMap &table_id_to_node_map)
ChunkKey genChunkKey(const std::vector<Fragmenter_Namespace::FragmentInfo> &fragments, const Analyzer::Expr *outer_col, const Analyzer::ColumnVar *inner_col) const
void reify()
std::shared_ptr<PerfectHashTable> initHashTableOnCpuFromCache(QueryPlanHash key, CacheItemType item_type, DeviceIdentifier device_identifier)
void putHashTableOnCpuToCache(QueryPlanHash key, CacheItemType item_type, std::shared_ptr<PerfectHashTable> hashtable_ptr, DeviceIdentifier device_identifier, size_t hashtable_building_time)
const InputTableInfo &getInnerQueryInfo(const Analyzer::ColumnVar *inner_col) const
size_t shardCount() const
llvm::Value *codegenHashTableLoad(const size_t table_idx)
std::vector<llvm::Value *> getHashJoinArgs(llvm::Value *hash_ptr, const Analyzer::Expr *key_col, const int shard_count, const CompilationOptions &co)
bool isBitwiseEq() const
size_t getComponentBufferSize() const
HashTable *getHashTableForDevice(const size_t device_id) const

Private Members

std::vector<InnerOuter> inner_outer_pairs_
std::shared_ptr<Analyzer::BinOper> qual_bin_oper_
const JoinType join_type_
std::shared_ptr<Analyzer::ColumnVar> col_var_
const std::vector<InputTableInfo> &query_infos_
const Data_Namespace::MemoryLevel memory_level_
HashType hash_type_
std::mutex cpu_hash_table_buff_mutex_
std::mutex str_proxy_translation_mutex_
const StringDictionaryProxy::IdMap *str_proxy_translation_map_ = {nullptr}
ExpressionRange col_range_
ExpressionRange rhs_source_col_range_
Executor *executor_
ColumnCacheMap &column_cache_
const int device_count_
bool needs_dict_translation_
QueryPlanHash hashtable_cache_key_
HashtableCacheMetaInfo hashtable_cache_meta_info_
std::unordered_set<size_t> table_keys_
const TableIdToNodeMap table_id_to_node_map_

Private Static Functions

static QueryPlanHash getAlternativeCacheKey(AlternativeCacheKeyForPerfectHashJoin &info)

Private Static Attributes

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

Public Members

const ExpressionRange col_range
const Analyzer::ColumnVar *inner_col
const Analyzer::ColumnVar *outer_col
const ChunkKey chunk_key
const size_t num_elements
const SQLOps optype
const JoinType join_type