54 :
public DataRecycler<std::shared_ptr<HashTable>, HashtableCacheMetaInfo> {
66 std::optional<HashtableCacheMetaInfo> meta_info = std::nullopt)
override;
70 std::shared_ptr<HashTable> item_ptr,
75 std::optional<HashtableCacheMetaInfo> meta_info = std::nullopt)
override;
83 std::unordered_set<QueryPlanHash>& key_set,
87 std::string
toString()
const override;
94 const std::vector<InnerOuter>& inner_outer_pairs,
95 const std::vector<InnerOuterStringOpInfos>& inner_outer_string_op_infos_pairs,
101 const std::vector<std::vector<Fragmenter_Namespace::FragmentInfo>>&
106 std::vector<const Analyzer::ColumnVar*>& outer_cols,
111 bool need_dict_translation,
112 const std::vector<InnerOuterStringOpInfos>& inner_outer_string_op_info_pairs,
128 std::shared_ptr<HashTable>,
129 std::optional<HashtableCacheMetaInfo>>
135 const std::unordered_set<size_t>& table_keys);
138 size_t table_key)
const;
147 std::lock_guard<std::mutex>& lock,
148 std::optional<HashtableCacheMetaInfo> meta_info = std::nullopt)
const override;
154 std::lock_guard<std::mutex>& lock,
155 std::optional<HashtableCacheMetaInfo> meta_info = std::nullopt)
override;
160 size_t required_size,
161 std::lock_guard<std::mutex>& lock,
162 std::optional<HashtableCacheMetaInfo> meta_info = std::nullopt)
override;
166 std::lock_guard<std::mutex>& lock);
bool hasItemInCache(QueryPlanHash key, CacheItemType item_type, DeviceIdentifier device_identifier, std::lock_guard< std::mutex > &lock, std::optional< HashtableCacheMetaInfo > meta_info=std::nullopt) const override
HashtableRecycler(CacheItemType hashtable_type, int num_gpus)
void putItemToCache(QueryPlanHash key, std::shared_ptr< HashTable > item_ptr, CacheItemType item_type, DeviceIdentifier device_identifier, size_t item_size, size_t compute_time, std::optional< HashtableCacheMetaInfo > meta_info=std::nullopt) override
static bool isInvalidHashTableCacheKey(const std::vector< QueryPlanHash > &cache_keys)
g_hashtable_cache_total_bytes
HashtableAccessPathInfo(int device_count)
constexpr QueryPlanHash EMPTY_HASHED_PLAN_DAG_KEY
static size_t getJoinColumnInfoHash(std::vector< const Analyzer::ColumnVar * > &inner_cols, std::vector< const Analyzer::ColumnVar * > &outer_cols, Executor *executor)
void addQueryPlanDagForTableKeys(size_t hashed_query_plan_dag, const std::unordered_set< size_t > &table_keys)
void removeCachedHashtableBuiltFromSyntheticTable(CacheItemType item_type, DeviceIdentifier device_identifier, std::lock_guard< std::mutex > &lock)
void cleanupCacheForInsertion(CacheItemType item_type, DeviceIdentifier device_identifier, size_t required_size, std::lock_guard< std::mutex > &lock, std::optional< HashtableCacheMetaInfo > meta_info=std::nullopt) override
std::unordered_set< size_t > table_keys
std::vector< QueryPlanHash > hashed_query_plan_dag
bool checkHashtableForBoundingBoxIntersectBucketCompatability(const BoundingBoxIntersectMetaInfo &candidate_bucket_dim, const BoundingBoxIntersectMetaInfo &target_bucket_dim) const
void initCache() override
std::unordered_map< size_t, HashTableBuildDag > HashTableBuildDagMap
std::unordered_map< size_t, std::unordered_set< size_t > > table_key_to_query_plan_dag_map_
g_max_cacheable_hashtable_size_bytes
std::unordered_map< shared::TableKey, const RelAlgNode * > TableIdToNodeMap
void removeItemFromCache(QueryPlanHash key, CacheItemType item_type, DeviceIdentifier device_identifier, std::lock_guard< std::mutex > &lock, std::optional< HashtableCacheMetaInfo > meta_info=std::nullopt) override
HashtableCacheMetaInfo meta_info
std::optional< std::unordered_set< size_t > > getMappedQueryPlanDagsWithTableKey(size_t table_key) const
std::string toString() const override
void markCachedItemAsDirty(size_t table_key, std::unordered_set< QueryPlanHash > &key_set, CacheItemType item_type, DeviceIdentifier device_identifier) override
void clearCache() override
void removeTableKeyInfoFromQueryPlanDagMap(size_t table_key)
static bool isSafeToCacheHashtable(const TableIdToNodeMap &table_id_to_node_map, bool need_dict_translation, const std::vector< InnerOuterStringOpInfos > &inner_outer_string_op_info_pairs, const shared::TableKey &table_key)
std::tuple< QueryPlanHash, std::shared_ptr< HashTable >, std::optional< HashtableCacheMetaInfo > > getCachedHashtableWithoutCacheKey(std::set< size_t > &visited, CacheItemType hash_table_type, DeviceIdentifier device_identifier)
virtual std::shared_ptr< HashTable > getItemFromCache(QueryPlanHash key, CacheItemType item_type, DeviceIdentifier device_identifier, std::optional< HashtableCacheMetaInfo > meta_info=std::nullopt)=0
static HashtableAccessPathInfo getHashtableAccessPathInfo(const std::vector< InnerOuter > &inner_outer_pairs, const std::vector< InnerOuterStringOpInfos > &inner_outer_string_op_infos_pairs, const SQLOps op_type, const JoinType join_type, const HashTableBuildDagMap &hashtable_build_dag_map, int device_count, int shard_count, const std::vector< std::vector< Fragmenter_Namespace::FragmentInfo >> &frags_for_device, Executor *executor)