OmniSciDB  04ee39c94c
anonymous_namespace{IRCodegen.cpp} Namespace Reference

Functions

void add_qualifier_to_execution_unit (RelAlgExecutionUnit &ra_exe_unit, const std::shared_ptr< Analyzer::Expr > &qual)
 
void check_if_loop_join_is_allowed (RelAlgExecutionUnit &ra_exe_unit, const ExecutionOptions &eo, const std::vector< InputTableInfo > &query_infos, const size_t level_idx, const std::string &fail_reason)
 

Function Documentation

◆ add_qualifier_to_execution_unit()

void anonymous_namespace{IRCodegen.cpp}::add_qualifier_to_execution_unit ( RelAlgExecutionUnit ra_exe_unit,
const std::shared_ptr< Analyzer::Expr > &  qual 
)

Definition at line 174 of file IRCodegen.cpp.

References qual_to_conjunctive_form(), RelAlgExecutionUnit::quals, and RelAlgExecutionUnit::simple_quals.

Referenced by Executor::buildCurrentLevelHashTable().

175  {
176  const auto qual_cf = qual_to_conjunctive_form(qual);
177  ra_exe_unit.simple_quals.insert(ra_exe_unit.simple_quals.end(),
178  qual_cf.simple_quals.begin(),
179  qual_cf.simple_quals.end());
180  ra_exe_unit.quals.insert(
181  ra_exe_unit.quals.end(), qual_cf.quals.begin(), qual_cf.quals.end());
182 }
QualsConjunctiveForm qual_to_conjunctive_form(const std::shared_ptr< Analyzer::Expr > qual_expr)
std::list< std::shared_ptr< Analyzer::Expr > > quals
std::list< std::shared_ptr< Analyzer::Expr > > simple_quals
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_if_loop_join_is_allowed()

void anonymous_namespace{IRCodegen.cpp}::check_if_loop_join_is_allowed ( RelAlgExecutionUnit ra_exe_unit,
const ExecutionOptions eo,
const std::vector< InputTableInfo > &  query_infos,
const size_t  level_idx,
const std::string &  fail_reason 
)

Definition at line 184 of file IRCodegen.cpp.

References ExecutionOptions::allow_loop_joins, is_trivial_loop_join(), and RelAlgExecutionUnit::join_quals.

Referenced by Executor::buildJoinLoops().

188  {
189  if (eo.allow_loop_joins) {
190  return;
191  }
192  if (level_idx + 1 != ra_exe_unit.join_quals.size()) {
193  throw std::runtime_error(
194  "Hash join failed, reason(s): " + fail_reason +
195  " | Cannot fall back to loop join for intermediate join quals");
196  }
197  if (!is_trivial_loop_join(query_infos, ra_exe_unit)) {
198  throw std::runtime_error(
199  "Hash join failed, reason(s): " + fail_reason +
200  " | Cannot fall back to loop join for non-trivial inner table size");
201  }
202 }
bool is_trivial_loop_join(const std::vector< InputTableInfo > &query_infos, const RelAlgExecutionUnit &ra_exe_unit)
Definition: Execute.cpp:1054
const JoinQualsPerNestingLevel join_quals
const bool allow_loop_joins
+ Here is the call graph for this function:
+ Here is the caller graph for this function: