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

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

Definition at line 155 of file EquiJoinCondition.cpp.

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

Referenced by HashJoin::getInstance().

156  {
157  std::vector<std::shared_ptr<Analyzer::Expr>> singleton_qual_list;
158  singleton_qual_list.push_back(join_qual);
159  return make_composite_equals_impl(singleton_qual_list);
160 }
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:

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

Definition at line 128 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().

129  {
130  if (join_quals.empty()) {
131  return {};
132  }
133  std::list<std::shared_ptr<Analyzer::Expr>> coalesced_quals;
134  std::vector<std::shared_ptr<Analyzer::Expr>> crt_coalesced_quals;
135  for (const auto& simple_join_qual : join_quals) {
136  if (crt_coalesced_quals.empty()) {
137  crt_coalesced_quals.push_back(simple_join_qual);
138  continue;
139  }
140  if (crt_coalesced_quals.size() >= g_maximum_conditions_to_coalesce ||
141  !can_combine_with(simple_join_qual.get(), crt_coalesced_quals.back().get())) {
142  coalesced_quals.splice(coalesced_quals.end(),
143  make_composite_equals(crt_coalesced_quals));
144  crt_coalesced_quals.clear();
145  }
146  crt_coalesced_quals.push_back(simple_join_qual);
147  }
148  if (!crt_coalesced_quals.empty()) {
149  coalesced_quals.splice(coalesced_quals.end(),
150  make_composite_equals(crt_coalesced_quals));
151  }
152  return coalesced_quals;
153 }
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: