OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RelAlgExecutionUnit Struct Reference

#include <RelAlgExecutionUnit.h>

+ Collaboration diagram for RelAlgExecutionUnit:

Public Member Functions

RelAlgExecutionUnit createNdvExecutionUnit (const int64_t range) const
 
RelAlgExecutionUnit createCountAllExecutionUnit (Analyzer::Expr *replacement_target) const
 
template<SQLAgg AggType>
void eachAggTarget (std::function< void(Analyzer::AggExpr const *, size_t target_idx)> lambda) const
 

Public Attributes

std::vector< InputDescriptorinput_descs
 
std::list< std::shared_ptr
< const InputColDescriptor > > 
input_col_descs
 
std::list< std::shared_ptr
< Analyzer::Expr > > 
simple_quals
 
std::list< std::shared_ptr
< Analyzer::Expr > > 
quals
 
const JoinQualsPerNestingLevel join_quals
 
const std::list
< std::shared_ptr
< Analyzer::Expr > > 
groupby_exprs
 
std::vector< Analyzer::Expr * > target_exprs
 
std::unordered_map< size_t,
SQLTypeInfo
target_exprs_original_type_infos
 
const std::shared_ptr
< Analyzer::Estimator
estimator
 
const SortInfo sort_info
 
size_t scan_limit
 
RegisteredQueryHint query_hint
 
QueryPlanHash query_plan_dag_hash {EMPTY_HASHED_PLAN_DAG_KEY}
 
HashTableBuildDagMap hash_table_build_plan_dag {}
 
TableIdToNodeMap table_id_to_node_map {}
 
bool use_bump_allocator {false}
 
const std::optional< bool > union_all
 
std::shared_ptr< const
query_state::QueryState
query_state
 
std::vector< Analyzer::Expr * > target_exprs_union
 
std::vector< std::pair
< std::vector< size_t >
, size_t > > 
per_device_cardinality
 

Detailed Description

Definition at line 165 of file RelAlgExecutionUnit.h.

Member Function Documentation

RelAlgExecutionUnit RelAlgExecutionUnit::createCountAllExecutionUnit ( Analyzer::Expr replacement_target) const

Definition at line 117 of file CardinalityEstimator.cpp.

References hash_table_build_plan_dag, input_col_descs, input_descs, join_quals, quals, query_hint, query_plan_dag_hash, query_state, simple_quals, strip_join_covered_filter_quals(), table_id_to_node_map, and union_all.

Referenced by RelAlgExecutor::getFilteredCountAll().

118  {
119  return {input_descs,
121  simple_quals,
123  join_quals,
124  {},
125  {replacement_target},
126  {},
127  nullptr,
128  SortInfo(),
129  0,
130  query_hint,
134  false,
135  union_all,
136  query_state,
137  {replacement_target},
138  /*per_device_cardinality=*/{}};
139 }
QueryPlanHash query_plan_dag_hash
const std::optional< bool > union_all
std::vector< InputDescriptor > input_descs
std::list< std::shared_ptr< Analyzer::Expr > > strip_join_covered_filter_quals(const std::list< std::shared_ptr< Analyzer::Expr >> &quals, const JoinQualsPerNestingLevel &join_quals)
const JoinQualsPerNestingLevel join_quals
TableIdToNodeMap table_id_to_node_map
std::list< std::shared_ptr< Analyzer::Expr > > quals
RegisteredQueryHint query_hint
std::shared_ptr< const query_state::QueryState > query_state
std::list< std::shared_ptr< const InputColDescriptor > > input_col_descs
std::list< std::shared_ptr< Analyzer::Expr > > simple_quals
HashTableBuildDagMap hash_table_build_plan_dag

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

RelAlgExecutionUnit RelAlgExecutionUnit::createNdvExecutionUnit ( const int64_t  range) const

Definition at line 91 of file CardinalityEstimator.cpp.

References g_large_ndv_threshold, groupby_exprs, hash_table_build_plan_dag, input_col_descs, input_descs, join_quals, quals, query_hint, query_plan_dag_hash, query_state, simple_quals, table_id_to_node_map, and union_all.

Referenced by RelAlgExecutor::getNDVEstimation().

92  {
93  const bool use_large_estimator =
94  range > g_large_ndv_threshold || groupby_exprs.size() > 1;
95  return {input_descs,
98  quals,
99  join_quals,
100  {},
101  {},
102  {},
103  use_large_estimator ? makeExpr<Analyzer::LargeNDVEstimator>(groupby_exprs)
104  : makeExpr<Analyzer::NDVEstimator>(groupby_exprs),
105  SortInfo(),
106  0,
107  query_hint,
111  false,
112  union_all,
113  query_state,
114  {}};
115 }
int64_t g_large_ndv_threshold
QueryPlanHash query_plan_dag_hash
const std::optional< bool > union_all
std::vector< InputDescriptor > input_descs
const std::list< std::shared_ptr< Analyzer::Expr > > groupby_exprs
const JoinQualsPerNestingLevel join_quals
TableIdToNodeMap table_id_to_node_map
std::list< std::shared_ptr< Analyzer::Expr > > quals
RegisteredQueryHint query_hint
std::shared_ptr< const query_state::QueryState > query_state
std::list< std::shared_ptr< const InputColDescriptor > > input_col_descs
std::list< std::shared_ptr< Analyzer::Expr > > simple_quals
HashTableBuildDagMap hash_table_build_plan_dag

+ Here is the caller graph for this function:

template<SQLAgg AggType>
void RelAlgExecutionUnit::eachAggTarget ( std::function< void(Analyzer::AggExpr const *, size_t target_idx)>  lambda) const
inline

Definition at line 194 of file RelAlgExecutionUnit.h.

References target_exprs.

Referenced by QueryMemoryInitializer::allocateModeBuffer(), QueryMemoryInitializer::allocateTDigestsBuffer(), GroupByAndAggregate::initApproxQuantileDescriptors(), QueryMemoryInitializer::initializeModeIndexSet(), and QueryMemoryInitializer::initializeQuantileParams().

195  {
196  for (size_t target_idx = 0; target_idx < target_exprs.size(); ++target_idx) {
197  Analyzer::Expr const* target_expr = target_exprs[target_idx];
198  if (auto const* agg_expr = dynamic_cast<Analyzer::AggExpr const*>(target_expr)) {
199  if (agg_expr->get_aggtype() == AggType) {
200  lambda(agg_expr, target_idx);
201  }
202  }
203  }
204  }
std::vector< Analyzer::Expr * > target_exprs

+ Here is the caller graph for this function:

Member Data Documentation

const std::list<std::shared_ptr<Analyzer::Expr> > RelAlgExecutionUnit::groupby_exprs
std::vector<InputDescriptor> RelAlgExecutionUnit::input_descs

Definition at line 166 of file RelAlgExecutionUnit.h.

Referenced by QueryFragmentDescriptor::buildFragmentKernelMap(), QueryFragmentDescriptor::buildFragmentPerKernelForTable(), QueryFragmentDescriptor::buildFragmentPerKernelMap(), QueryFragmentDescriptor::buildFragmentPerKernelMapForUnion(), Executor::buildIsDeletedCb(), QueryFragmentDescriptor::buildMultifragKernelMap(), Executor::buildSelectedFragsMapping(), Executor::buildSelectedFragsMappingForUnion(), anonymous_namespace{IRCodegen.cpp}::check_if_loop_join_is_allowed(), anonymous_namespace{Execute.cpp}::checkWorkUnitWatchdog(), QueryFragmentDescriptor::computeAllTablesFragments(), RelAlgExecutor::computeWindow(), createCountAllExecutionUnit(), Executor::createKernels(), createNdvExecutionUnit(), RelAlgExecutor::createSortInputWorkUnit(), Executor::executePlanWithGroupBy(), RelAlgExecutor::executeWorkUnit(), Executor::fetchChunks(), Executor::fetchUnionChunks(), find_push_down_filters(), anonymous_namespace{SerializeToSql.cpp}::from_to_string(), anonymous_namespace{QueryMemoryInitializer.cpp}::get_input_idx(), get_loop_join_size(), get_table_infos(), Executor::getFragmentCount(), Executor::getTableFragmentIndices(), anonymous_namespace{QueryFragmentDescriptor.cpp}::is_sample_query(), RelAlgExecutor::isRowidLookup(), Executor::needFetchAllFragments(), QueryFragmentDescriptor::QueryFragmentDescriptor(), anonymous_namespace{Execute.cpp}::replace_scan_limit(), QueryRewriter::rewriteAggregateOnGroupByColumn(), QueryRewriter::rewriteColumnarDelete(), QueryRewriter::rewriteColumnarUpdate(), QueryRewriter::rewriteConstrainedByInImpl(), ExecutionKernel::runImpl(), RelAlgExecutor::selectFiltersToBePushedDown(), Executor::skipFragmentPair(), and anonymous_namespace{QueryMemoryDescriptor.cpp}::target_expr_proj_indices().

std::vector<std::pair<std::vector<size_t>, size_t> > RelAlgExecutionUnit::per_device_cardinality
mutable
std::vector<Analyzer::Expr*> RelAlgExecutionUnit::target_exprs

Definition at line 172 of file RelAlgExecutionUnit.h.

Referenced by Executor::addTransientStringLiterals(), QueryMemoryInitializer::allocateCountDistinctBuffers(), QueryMemoryInitializer::allocateModeBuffer(), QueryMemoryInitializer::allocateTDigestsBuffer(), SpeculativeTopNMap::asRows(), QueryMemoryInitializer::calculateCountDistinctBufferSize(), anonymous_namespace{RelAlgExecutor.cpp}::can_output_columnar(), CardinalityCacheKey::CardinalityCacheKey(), anonymous_namespace{QueryMemoryInitializer.cpp}::check_count_distinct_expr_metadata(), anonymous_namespace{Execute.cpp}::checkWorkUnitWatchdog(), GroupByAndAggregate::codegen(), GroupByAndAggregate::codegenAggCalls(), GroupByAndAggregate::codegenOutputSlot(), anonymous_namespace{QueryMemoryInitializer.cpp}::collect_target_expr_metadata(), Executor::collectAllDeviceResults(), anonymous_namespace{RelAlgExecutor.cpp}::compute_output_buffer_size(), RelAlgExecutor::computeWindow(), Executor::createKernels(), anonymous_namespace{RelAlgExecutor.cpp}::decide_approx_count_distinct_implementation(), eachAggTarget(), RelAlgExecutor::executeWorkUnit(), anonymous_namespace{GroupByAndAggregate.cpp}::get_keyless_info(), get_text_cast_counts(), GroupByAndAggregate::getColRangeInfo(), Executor::getDeviceTypeForTargets(), RowFunctionManager::getDictDbId(), RowFunctionManager::getDictId(), GroupByAndAggregate::gpuCanHandleOrderEntries(), anonymous_namespace{GroupByAndAggregate.cpp}::has_count_distinct(), QueryMemoryDescriptor::init(), anonymous_namespace{GroupByAndAggregate.cpp}::init_count_distinct_descriptors(), QueryMemoryInitializer::initColumnarGroups(), QueryMemoryInitializer::initializeModeIndexSet(), QueryMemoryInitializer::initializeQuantileParams(), anonymous_namespace{RelAlgExecutor.cpp}::is_window_execution_unit(), anonymous_namespace{ExecutionKernel.cpp}::need_to_hold_chunk(), operator<<(), QueryMemoryDescriptor::pick_target_compact_width(), QueryMemoryDescriptor::QueryMemoryDescriptor(), QueryMemoryInitializer::QueryMemoryInitializer(), Executor::reduceMultiDeviceResults(), Executor::reduceSpeculativeTopN(), anonymous_namespace{Execute.cpp}::replace_scan_limit(), Executor::resultsUnion(), QueryRewriter::rewriteAggregateOnGroupByColumn(), QueryRewriter::rewriteColumnarDelete(), QueryRewriter::rewriteColumnarUpdate(), QueryRewriter::rewriteConstrainedByInImpl(), ExecutionKernel::runImpl(), anonymous_namespace{RelAlgExecutor.cpp}::should_output_columnar(), anonymous_namespace{QueryMemoryDescriptor.cpp}::target_expr_proj_indices(), anonymous_namespace{SerializeToSql.cpp}::targets_to_string(), use_speculative_top_n(), and anonymous_namespace{QueryMemoryDescriptor.cpp}::use_streaming_top_n().


The documentation for this struct was generated from the following files: