OmniSciDB  b24e664e58
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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

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

Definition at line 186 of file IRCodegen.cpp.

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

Referenced by Executor::buildCurrentLevelHashTable().

187  {
188  const auto qual_cf = qual_to_conjunctive_form(qual);
189  ra_exe_unit.simple_quals.insert(ra_exe_unit.simple_quals.end(),
190  qual_cf.simple_quals.begin(),
191  qual_cf.simple_quals.end());
192  ra_exe_unit.quals.insert(
193  ra_exe_unit.quals.end(), qual_cf.quals.begin(), qual_cf.quals.end());
194 }
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:

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 196 of file IRCodegen.cpp.

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

200  {
201  if (eo.allow_loop_joins) {
202  return;
203  }
204  if (level_idx + 1 != ra_exe_unit.join_quals.size()) {
205  throw std::runtime_error(
206  "Hash join failed, reason(s): " + fail_reason +
207  " | Cannot fall back to loop join for intermediate join quals");
208  }
209  if (!is_trivial_loop_join(query_infos, ra_exe_unit)) {
210  throw std::runtime_error(
211  "Hash join failed, reason(s): " + fail_reason +
212  " | Cannot fall back to loop join for non-trivial inner table size");
213  }
214 }
bool is_trivial_loop_join(const std::vector< InputTableInfo > &query_infos, const RelAlgExecutionUnit &ra_exe_unit)
Definition: Execute.cpp:1067
const JoinQualsPerNestingLevel join_quals
const bool allow_loop_joins

+ Here is the call graph for this function: