OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JoinCoveredQualVisitor Class Reference
+ Inheritance diagram for JoinCoveredQualVisitor:
+ Collaboration diagram for JoinCoveredQualVisitor:

Public Member Functions

 JoinCoveredQualVisitor (const JoinQualsPerNestingLevel &join_quals)
 
bool visitFunctionOper (const Analyzer::FunctionOper *func_oper) const override
 
bool defaultResult () const override
 
- Public Member Functions inherited from ScalarExprVisitor< bool >
bool visit (const Analyzer::Expr *expr) const
 

Private Attributes

std::vector< std::pair< const
Analyzer::Expr *, const
Analyzer::Expr * > > 
join_qual_pairs
 

Additional Inherited Members

- Protected Member Functions inherited from ScalarExprVisitor< bool >
virtual bool visitVar (const Analyzer::Var *) const
 
virtual bool visitColumnVar (const Analyzer::ColumnVar *) const
 
virtual bool visitColumnVarTuple (const Analyzer::ExpressionTuple *) const
 
virtual bool visitConstant (const Analyzer::Constant *) const
 
virtual bool visitUOper (const Analyzer::UOper *uoper) const
 
virtual bool visitBinOper (const Analyzer::BinOper *bin_oper) const
 
virtual bool visitGeoExpr (const Analyzer::GeoExpr *geo_expr) const
 
virtual bool visitInValues (const Analyzer::InValues *in_values) const
 
virtual bool visitInIntegerSet (const Analyzer::InIntegerSet *in_integer_set) const
 
virtual bool visitCharLength (const Analyzer::CharLengthExpr *char_length) const
 
virtual bool visitKeyForString (const Analyzer::KeyForStringExpr *key_for_string) const
 
virtual bool visitSampleRatio (const Analyzer::SampleRatioExpr *sample_ratio) const
 
virtual bool visitStringOper (const Analyzer::StringOper *string_oper) const
 
virtual bool visitCardinality (const Analyzer::CardinalityExpr *cardinality) const
 
virtual bool visitLikeExpr (const Analyzer::LikeExpr *like) const
 
virtual bool visitRegexpExpr (const Analyzer::RegexpExpr *regexp) const
 
virtual bool visitWidthBucket (const Analyzer::WidthBucketExpr *width_bucket_expr) const
 
virtual bool visitMLPredict (const Analyzer::MLPredictExpr *ml_predict_expr) const
 
virtual bool visitPCAProject (const Analyzer::PCAProjectExpr *pca_project_expr) const
 
virtual bool visitCaseExpr (const Analyzer::CaseExpr *case_) const
 
virtual bool visitDatetruncExpr (const Analyzer::DatetruncExpr *datetrunc) const
 
virtual bool visitExtractExpr (const Analyzer::ExtractExpr *extract) const
 
virtual bool visitFunctionOperWithCustomTypeHandling (const Analyzer::FunctionOperWithCustomTypeHandling *func_oper) const
 
virtual bool visitArrayOper (Analyzer::ArrayExpr const *array_expr) const
 
virtual bool visitGeoUOper (const Analyzer::GeoUOper *geo_expr) const
 
virtual bool visitGeoBinOper (const Analyzer::GeoBinOper *geo_expr) const
 
virtual bool visitWindowFunction (const Analyzer::WindowFunction *window_func) const
 
virtual bool visitDatediffExpr (const Analyzer::DatediffExpr *datediff) const
 
virtual bool visitDateaddExpr (const Analyzer::DateaddExpr *dateadd) const
 
virtual bool visitLikelihood (const Analyzer::LikelihoodExpr *likelihood) const
 
virtual bool visitOffsetInFragment (const Analyzer::OffsetInFragment *) const
 
virtual bool visitAggExpr (const Analyzer::AggExpr *agg) const
 
virtual bool visitRangeJoinOper (const Analyzer::RangeOper *range_oper) const
 
virtual bool aggregateResult (const bool &aggregate, const bool &next_result) const
 
virtual void visitBegin () const
 

Detailed Description

JoinCoveredQualVisitor returns true if the visited qual is true if and only if a corresponding equijoin qual is true. During the pre-filtered count we can elide the visited qual decreasing query run time while upper bounding the number of rows passing the filter. Currently only used for expressions of the form a OVERLAPS b AND Expr<a, b>. Strips Expr<a,b> if the expression has been pre-determined to be expensive to compute twice.

Definition at line 1298 of file ExpressionRewrite.cpp.

Constructor & Destructor Documentation

JoinCoveredQualVisitor::JoinCoveredQualVisitor ( const JoinQualsPerNestingLevel join_quals)
inline

Definition at line 1300 of file ExpressionRewrite.cpp.

References join_qual_pairs.

1300  {
1301  for (const auto& join_condition : join_quals) {
1302  for (const auto& qual : join_condition.quals) {
1303  auto qual_bin_oper = dynamic_cast<Analyzer::BinOper*>(qual.get());
1304  if (qual_bin_oper) {
1305  join_qual_pairs.emplace_back(qual_bin_oper->get_left_operand(),
1306  qual_bin_oper->get_right_operand());
1307  }
1308  }
1309  }
1310  }
std::vector< std::pair< const Analyzer::Expr *, const Analyzer::Expr * > > join_qual_pairs

Member Function Documentation

bool JoinCoveredQualVisitor::defaultResult ( ) const
inlineoverridevirtual

Reimplemented from ScalarExprVisitor< bool >.

Definition at line 1326 of file ExpressionRewrite.cpp.

1326 { return false; }
bool JoinCoveredQualVisitor::visitFunctionOper ( const Analyzer::FunctionOper func_oper) const
inlineoverridevirtual

Reimplemented from ScalarExprVisitor< bool >.

Definition at line 1312 of file ExpressionRewrite.cpp.

References Analyzer::FunctionOper::getArg(), Analyzer::FunctionOper::getName(), BoundingBoxIntersectJoinSupportedFunction::is_bbox_intersect_supported_func(), and join_qual_pairs.

1312  {
1314  func_oper->getName())) {
1315  const auto lhs = func_oper->getArg(2);
1316  const auto rhs = func_oper->getArg(1);
1317  for (const auto& qual_pair : join_qual_pairs) {
1318  if (*lhs == *qual_pair.first && *rhs == *qual_pair.second) {
1319  return true;
1320  }
1321  }
1322  }
1323  return false;
1324  }
static bool is_bbox_intersect_supported_func(std::string_view target_func_name)
std::vector< std::pair< const Analyzer::Expr *, const Analyzer::Expr * > > join_qual_pairs
const Analyzer::Expr * getArg(const size_t i) const
Definition: Analyzer.h:2748
std::string getName() const
Definition: Analyzer.h:2744

+ Here is the call graph for this function:

Member Data Documentation

std::vector<std::pair<const Analyzer::Expr*, const Analyzer::Expr*> > JoinCoveredQualVisitor::join_qual_pairs
private

Definition at line 1329 of file ExpressionRewrite.cpp.

Referenced by JoinCoveredQualVisitor(), and visitFunctionOper().


The documentation for this class was generated from the following file: