OmniSciDB
a5dc49c757
|
#include <QueryPlanDagCache.h>
Public Member Functions | |
QueryPlanDagCache (size_t max_node_cache_size=MAX_NODE_CACHE_SIZE) | |
QueryPlanDagCache (QueryPlanDagCache &&other)=delete | |
QueryPlanDagCache & | operator= (QueryPlanDagCache &&other)=delete |
QueryPlanDagCache (const QueryPlanDagCache &)=delete | |
QueryPlanDagCache & | operator= (const QueryPlanDagCache &)=delete |
std::optional< RelNodeId > | addNodeIfAbsent (const RelAlgNode *) |
void | connectNodes (const RelNodeId parent_id, const RelNodeId child_id) |
std::vector< const Analyzer::ColumnVar * > | collectColVars (const Analyzer::Expr *target) |
size_t | getCurrentNodeMapSize () const |
void | setNodeMapMaxSize (const size_t map_size) |
size_t | getJoinColumnsInfoHash (const Analyzer::Expr *join_expr, JoinColumnSide target_side, bool extract_only_col_id) |
size_t | translateColVarsToInfoHash (std::vector< const Analyzer::ColumnVar * > &col_vars, bool col_id_only) const |
void | clearQueryPlanCache () |
void | printDag () |
Private Member Functions | |
size_t | getCurrentNodeMapSizeUnlocked () const |
size_t | getCurrentNodeMapCardinality () const |
Private Attributes | |
RelNodeMap | node_map_ |
QueryPlanDag | cached_query_plan_dag_ |
size_t | max_node_map_size_ |
std::mutex | cache_lock_ |
ColumnVarsVisitor | col_var_visitor_ |
Definition at line 110 of file QueryPlanDagCache.h.
|
inline |
Definition at line 112 of file QueryPlanDagCache.h.
|
delete |
|
delete |
std::optional< RelNodeId > QueryPlanDagCache::addNodeIfAbsent | ( | const RelAlgNode * | node | ) |
Definition at line 25 of file QueryPlanDagCache.cpp.
References cache_lock_, cached_query_plan_dag_, getCurrentNodeMapCardinality(), getCurrentNodeMapSizeUnlocked(), max_node_map_size_, node_map_, run_benchmark_import::result, and RelAlgNode::toHash().
Referenced by QueryPlanDagExtractor::extractQueryPlanDagImpl(), QueryPlanDagExtractor::handleTranslatedJoin(), and QueryPlanDagExtractor::register_and_visit().
void QueryPlanDagCache::clearQueryPlanCache | ( | ) |
Definition at line 146 of file QueryPlanDagCache.cpp.
References cache_lock_, cached_query_plan_dag_, and node_map_.
std::vector< const Analyzer::ColumnVar * > QueryPlanDagCache::collectColVars | ( | const Analyzer::Expr * | target | ) |
Definition at line 152 of file QueryPlanDagCache.cpp.
References col_var_visitor_, and ScalarExprVisitor< T >::visit().
Referenced by QueryPlanDagExtractor::getColVar(), and getJoinColumnsInfoHash().
Definition at line 42 of file QueryPlanDagCache.cpp.
References cache_lock_, and cached_query_plan_dag_.
Referenced by QueryPlanDagExtractor::registerNodeToDagCache().
|
private |
Definition at line 142 of file QueryPlanDagCache.cpp.
References node_map_.
Referenced by addNodeIfAbsent().
size_t QueryPlanDagCache::getCurrentNodeMapSize | ( | ) | const |
Definition at line 133 of file QueryPlanDagCache.cpp.
References cache_lock_, and getCurrentNodeMapSizeUnlocked().
|
private |
Definition at line 138 of file QueryPlanDagCache.cpp.
References elem_size_, and node_map_.
Referenced by addNodeIfAbsent(), and getCurrentNodeMapSize().
size_t QueryPlanDagCache::getJoinColumnsInfoHash | ( | const Analyzer::Expr * | join_expr, |
JoinColumnSide | target_side, | ||
bool | extract_only_col_id | ||
) |
Definition at line 78 of file QueryPlanDagCache.cpp.
References CHECK, collectColVars(), EMPTY_HASHED_PLAN_DAG_KEY, kDirect, kInner, kOuter, kQual, and translateColVarsToInfoHash().
|
delete |
|
delete |
void QueryPlanDagCache::printDag | ( | ) |
Definition at line 122 of file QueryPlanDagCache.cpp.
References cached_query_plan_dag_, and node_map_.
void QueryPlanDagCache::setNodeMapMaxSize | ( | const size_t | map_size | ) |
Definition at line 50 of file QueryPlanDagCache.cpp.
References cache_lock_, and max_node_map_size_.
size_t QueryPlanDagCache::translateColVarsToInfoHash | ( | std::vector< const Analyzer::ColumnVar * > & | col_vars, |
bool | col_id_only | ||
) | const |
Definition at line 55 of file QueryPlanDagCache.cpp.
References EMPTY_HASHED_PLAN_DAG_KEY, Analyzer::ColumnVar::getColumnKey(), and gpu_enabled::sort().
Referenced by getJoinColumnsInfoHash(), and QueryPlanDagExtractor::handleTranslatedJoin().
|
mutableprivate |
Definition at line 154 of file QueryPlanDagCache.h.
Referenced by addNodeIfAbsent(), clearQueryPlanCache(), connectNodes(), getCurrentNodeMapSize(), and setNodeMapMaxSize().
|
private |
Definition at line 148 of file QueryPlanDagCache.h.
Referenced by addNodeIfAbsent(), clearQueryPlanCache(), connectNodes(), and printDag().
|
private |
Definition at line 155 of file QueryPlanDagCache.h.
Referenced by collectColVars().
|
private |
Definition at line 151 of file QueryPlanDagCache.h.
Referenced by addNodeIfAbsent(), and setNodeMapMaxSize().
|
private |
Definition at line 146 of file QueryPlanDagCache.h.
Referenced by addNodeIfAbsent(), clearQueryPlanCache(), getCurrentNodeMapCardinality(), getCurrentNodeMapSizeUnlocked(), and printDag().