OmniSciDB  04ee39c94c
EquiJoinCondition.cpp File Reference
+ Include dependency graph for EquiJoinCondition.cpp:

Go to the source code of this file.

Namespaces

 anonymous_namespace{EquiJoinCondition.cpp}
 

Functions

bool anonymous_namespace{EquiJoinCondition.cpp}::can_combine_with (const Analyzer::Expr *crt, const Analyzer::Expr *prev)
 
std::list< std::shared_ptr< Analyzer::Expr > > anonymous_namespace{EquiJoinCondition.cpp}::make_composite_equals_impl (const std::vector< std::shared_ptr< Analyzer::Expr >> &crt_coalesced_quals)
 
std::list< std::shared_ptr< Analyzer::Expr > > anonymous_namespace{EquiJoinCondition.cpp}::make_composite_equals (const std::vector< std::shared_ptr< Analyzer::Expr >> &crt_coalesced_quals)
 
std::list< std::shared_ptr< Analyzer::Expr > > combine_equi_join_conditions (const std::list< std::shared_ptr< Analyzer::Expr >> &join_quals)
 
std::list< std::shared_ptr< Analyzer::Expr > > coalesce_singleton_equi_join (const std::shared_ptr< Analyzer::BinOper > &join_qual)
 

Function Documentation

◆ coalesce_singleton_equi_join()

std::list<std::shared_ptr<Analyzer::Expr> > coalesce_singleton_equi_join ( const std::shared_ptr< Analyzer::BinOper > &  join_qual)

Definition at line 138 of file EquiJoinCondition.cpp.

References anonymous_namespace{EquiJoinCondition.cpp}::make_composite_equals_impl().

Referenced by Executor::buildHashTableForQualifier().

139  {
140  std::vector<std::shared_ptr<Analyzer::Expr>> singleton_qual_list;
141  singleton_qual_list.push_back(join_qual);
142  return make_composite_equals_impl(singleton_qual_list);
143 }
std::list< std::shared_ptr< Analyzer::Expr > > make_composite_equals_impl(const std::vector< std::shared_ptr< Analyzer::Expr >> &crt_coalesced_quals)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ combine_equi_join_conditions()

std::list<std::shared_ptr<Analyzer::Expr> > combine_equi_join_conditions ( const std::list< std::shared_ptr< Analyzer::Expr >> &  join_quals)

Definition at line 111 of file EquiJoinCondition.cpp.

References anonymous_namespace{EquiJoinCondition.cpp}::can_combine_with(), g_maximum_conditions_to_coalesce, and anonymous_namespace{EquiJoinCondition.cpp}::make_composite_equals().

Referenced by RelAlgExecutor::makeJoinQuals().

112  {
113  if (join_quals.empty()) {
114  return {};
115  }
116  std::list<std::shared_ptr<Analyzer::Expr>> coalesced_quals;
117  std::vector<std::shared_ptr<Analyzer::Expr>> crt_coalesced_quals;
118  for (const auto& simple_join_qual : join_quals) {
119  if (crt_coalesced_quals.empty()) {
120  crt_coalesced_quals.push_back(simple_join_qual);
121  continue;
122  }
123  if (crt_coalesced_quals.size() >= g_maximum_conditions_to_coalesce ||
124  !can_combine_with(simple_join_qual.get(), crt_coalesced_quals.back().get())) {
125  coalesced_quals.splice(coalesced_quals.end(),
126  make_composite_equals(crt_coalesced_quals));
127  crt_coalesced_quals.clear();
128  }
129  crt_coalesced_quals.push_back(simple_join_qual);
130  }
131  if (!crt_coalesced_quals.empty()) {
132  coalesced_quals.splice(coalesced_quals.end(),
133  make_composite_equals(crt_coalesced_quals));
134  }
135  return coalesced_quals;
136 }
std::list< std::shared_ptr< Analyzer::Expr > > make_composite_equals(const std::vector< std::shared_ptr< Analyzer::Expr >> &crt_coalesced_quals)
bool can_combine_with(const Analyzer::Expr *crt, const Analyzer::Expr *prev)
const size_t g_maximum_conditions_to_coalesce
+ Here is the call graph for this function:
+ Here is the caller graph for this function: