>From Vijay Sarathy <[email protected]>:

Vijay Sarathy has uploaded this change for review. ( 
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17392 )


Change subject: [ASTERIXDB-3114]COMP] Do not show cost if CBO is turned off
......................................................................

[ASTERIXDB-3114]COMP] Do not show cost if CBO is turned off

Change-Id: Ife7af4d402098a0f83b4f1f01eac645fb8448035
---
M 
asterixdb/asterix-app/src/main/java/org/apache/asterix/api/common/APIFramework.java
1 file changed, 18 insertions(+), 8 deletions(-)



  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/92/17392/1

diff --git 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/common/APIFramework.java
 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/common/APIFramework.java
index 3409621..be21673 100644
--- 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/common/APIFramework.java
+++ 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/common/APIFramework.java
@@ -215,16 +215,12 @@
         ILogicalPlan plan =
                 isLoad ? t.translateLoad(statement) : t.translate(query, 
outputDatasetName, statement, resultMetadata);

-        if ((isQuery || isLoad) && 
!conf.is(SessionConfig.FORMAT_ONLY_PHYSICAL_OPS)
-                && conf.is(SessionConfig.OOB_LOGICAL_PLAN)) {
-            generateLogicalPlan(plan, output.config().getPlanFormat(), 
isExplainOnly);
-        }
         ICcApplicationContext ccAppContext = 
metadataProvider.getApplicationContext();
         CompilerProperties compilerProperties = 
ccAppContext.getCompilerProperties();
         Map<String, Object> querySpecificConfig = 
validateConfig(metadataProvider.getConfig(), sourceLoc);
         final PhysicalOptimizationConfig physOptConf =
                 
OptimizationConfUtil.createPhysicalOptimizationConf(compilerProperties, 
querySpecificConfig, sourceLoc);
-
+        boolean cboMode = physOptConf.getCBOMode() || 
physOptConf.getCBOTestMode();
         HeuristicCompilerFactoryBuilder builder =
                 new 
HeuristicCompilerFactoryBuilder(OptimizationContextFactory.INSTANCE);
         builder.setPhysicalOptimizationConfig(physOptConf);
@@ -242,6 +238,11 @@
         builder.setWarningCollector(warningCollector);
         builder.setMaxWarnings(conf.getMaxWarnings());

+        if ((isQuery || isLoad) && 
!conf.is(SessionConfig.FORMAT_ONLY_PHYSICAL_OPS)
+                && conf.is(SessionConfig.OOB_LOGICAL_PLAN)) {
+            generateLogicalPlan(plan, output.config().getPlanFormat(), 
cboMode);
+        }
+
         int parallelism = getParallelism((String) 
querySpecificConfig.get(CompilerProperties.COMPILER_PARALLELISM_KEY),
                 compilerProperties.getParallelism());
         AlgebricksAbsolutePartitionConstraint computationLocations =
@@ -277,7 +278,7 @@
                     output.out().write(buf.toString());
                 } else {
                     if (isQuery || isLoad) {
-                        generateOptimizedLogicalPlan(plan, 
output.config().getPlanFormat(), isExplainOnly);
+                        generateOptimizedLogicalPlan(plan, 
output.config().getPlanFormat(), cboMode);
                     }
                 }
             }
@@ -312,7 +313,7 @@

         if (!conf.isGenerateJobSpec()) {
             if (isQuery || isLoad) {
-                generateOptimizedLogicalPlan(plan, 
output.config().getPlanFormat(), isExplainOnly);
+                generateOptimizedLogicalPlan(plan, 
output.config().getPlanFormat(), cboMode);
             }
             return null;
         }
@@ -337,7 +338,7 @@

         if (conf.is(SessionConfig.OOB_OPTIMIZED_LOGICAL_PLAN) || 
isExplainOnly) {
             if (isQuery || isLoad) {
-                generateOptimizedLogicalPlan(plan, 
output.config().getPlanFormat(), isExplainOnly);
+                generateOptimizedLogicalPlan(plan, 
output.config().getPlanFormat(), cboMode);
             }
         }


--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17392
To unsubscribe, or for help writing mail filters, visit 
https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: neo
Gerrit-Change-Id: Ife7af4d402098a0f83b4f1f01eac645fb8448035
Gerrit-Change-Number: 17392
Gerrit-PatchSet: 1
Gerrit-Owner: Vijay Sarathy <[email protected]>
Gerrit-MessageType: newchange

Reply via email to