You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by hz...@apache.org on 2017/10/04 01:24:28 UTC

[2/7] incubator-trafodion git commit: [TRAFODION-2736] Missing predicates on salt columns

[TRAFODION-2736] Missing predicates on salt columns

In some cases, when we generate an index join (join of
an alternate index with the clustering index), we lost
the generated predicates on computed columns such as
salt and division.


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/4327078e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/4327078e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/4327078e

Branch: refs/heads/master
Commit: 4327078e805617293c7a7ae028763b0949f6ec9f
Parents: 279a9fd
Author: Hans Zeller <hz...@apache.org>
Authored: Tue Oct 3 17:02:04 2017 +0000
Committer: Hans Zeller <hz...@apache.org>
Committed: Tue Oct 3 17:02:04 2017 +0000

----------------------------------------------------------------------
 core/sql/optimizer/RelScan.h     | 5 ++---
 core/sql/optimizer/TransRule.cpp | 1 +
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/4327078e/core/sql/optimizer/RelScan.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelScan.h b/core/sql/optimizer/RelScan.h
index 1a46119..58af7cd 100644
--- a/core/sql/optimizer/RelScan.h
+++ b/core/sql/optimizer/RelScan.h
@@ -448,6 +448,8 @@ public:
   const SET(IndexDesc *)& deriveIndexOnlyIndexDesc();
   const SET(IndexDesc *)& deriveIndexJoinIndexDesc();
   const SET(IndexDesc *)& getIndexJoinIndexDesc(){ return indexJoinScans_; }
+  inline void setComputedPredicates(const ValueIdSet &ccPreds)
+                                             { generatedCCPreds_ = ccPreds; }
 
   const LIST(ScanIndexInfo *) &getIndexInfo()
                                            { return possibleIndexJoins_; }
@@ -661,9 +663,6 @@ protected:
                                             const ValueIdList& ikeys,
                                             CostScalar& rowsToScan);
 
-  inline void setComputedPredicates(const ValueIdSet &ccPreds)
-                                             { generatedCCPreds_ = ccPreds; }
-
 private:
 
   // the first param to this method, vid, is assumed to a OR predicate

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/4327078e/core/sql/optimizer/TransRule.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/TransRule.cpp b/core/sql/optimizer/TransRule.cpp
index 481eadb..5d6e846 100644
--- a/core/sql/optimizer/TransRule.cpp
+++ b/core/sql/optimizer/TransRule.cpp
@@ -1477,6 +1477,7 @@ RelExpr * IndexJoinRule1::makeSubstituteFromIndexInfo(Scan *bef,
 
   // the index predicates go to the left scan
   leftScan->selectionPred() += ixi->indexPredicates_;
+  leftScan->setComputedPredicates(bef->getComputedPredicates());
 
   ValueIdSet selectionpreds;
   if ((CmpCommon::getDefault(RANGESPEC_TRANSFORMATION) == DF_ON ) &&