Repository: trafodion
Updated Branches:
  refs/heads/master 2be44ed1b -> aec5108ad


[TRAFODION-2966] Fix new MDAM costing code to respect CQS forces


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

Branch: refs/heads/master
Commit: 5711693cc353dd3bf6c7a26bd538a3298202b2f3
Parents: 75c7b39
Author: Dave Birdsall <[email protected]>
Authored: Tue Feb 27 23:37:17 2018 +0000
Committer: Dave Birdsall <[email protected]>
Committed: Tue Feb 27 23:37:17 2018 +0000

----------------------------------------------------------------------
 core/sql/optimizer/ScanOptimizer.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/5711693c/core/sql/optimizer/ScanOptimizer.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ScanOptimizer.cpp 
b/core/sql/optimizer/ScanOptimizer.cpp
index 9d859f5..c9b40aa 100644
--- a/core/sql/optimizer/ScanOptimizer.cpp
+++ b/core/sql/optimizer/ScanOptimizer.cpp
@@ -10350,10 +10350,11 @@ void NewMDAMCostWA::compute()
   CostScalar costAdj = 
(ActiveSchemaDB()->getDefaults()).getAsDouble(NCM_MDAM_COST_ADJ_FACTOR);
   scmCost_->cpScmlr().scaleByValue(costAdj);
 
-  // If the cost exceeds the bound, MDAM loses
+  // If MDAM is not forced and the cost exceeds the bound, MDAM loses
 
-  if (costBoundPtr_ != NULL &&
-      costBoundPtr_->scmCompareCosts(*scmCost_) == LESS)
+  if (!mdamForced_ &&
+      (costBoundPtr_ != NULL) &&
+      (costBoundPtr_->scmCompareCosts(*scmCost_) == LESS))
   {
     mdamWon_ = FALSE;
     MDAM_DEBUG0(MTL2, "Mdam scan lost due to higher cost determined by 
scmCompareCosts()");

Reply via email to