OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EquiJoinCondition.h File Reference
#include <list>
#include <memory>
+ Include dependency graph for EquiJoinCondition.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 Analyzer
 

Functions

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 156 of file EquiJoinCondition.cpp.

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

Referenced by HashJoin::getInstance().

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

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