quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zu...@apache.org
Subject incubator-quickstep git commit: Constructed Generators once in the optimizer.
Date Thu, 04 Aug 2016 00:19:25 GMT
Repository: incubator-quickstep
Updated Branches:
  refs/heads/refactor-optimizer [created] 15d2cbd6d


Constructed Generators once in the optimizer.


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/15d2cbd6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/15d2cbd6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/15d2cbd6

Branch: refs/heads/refactor-optimizer
Commit: 15d2cbd6d7f3814956bf92e264a34d7064d7dfc7
Parents: 1b07eaa
Author: Zuyu Zhang <zuyuz@twitter.com>
Authored: Wed Aug 3 17:19:07 2016 -0700
Committer: Zuyu Zhang <zuyuz@twitter.com>
Committed: Wed Aug 3 17:19:07 2016 -0700

----------------------------------------------------------------------
 query_optimizer/Optimizer.cpp | 6 ++----
 query_optimizer/Optimizer.hpp | 7 ++++++-
 2 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/15d2cbd6/query_optimizer/Optimizer.cpp
----------------------------------------------------------------------
diff --git a/query_optimizer/Optimizer.cpp b/query_optimizer/Optimizer.cpp
index 08629fc..644b2a3 100644
--- a/query_optimizer/Optimizer.cpp
+++ b/query_optimizer/Optimizer.cpp
@@ -26,13 +26,11 @@ namespace optimizer {
 
 void Optimizer::generateQueryHandle(const ParseStatement &parse_statement,
                                     QueryHandle *query_handle) {
-  LogicalGenerator logical_generator(&optimizer_context_);
-  PhysicalGenerator physical_generator;
   ExecutionGenerator execution_generator(&optimizer_context_, query_handle);
 
   execution_generator.generatePlan(
-      physical_generator.generatePlan(
-          logical_generator.generatePlan(parse_statement)));
+      physical_generator_.generatePlan(
+          logical_generator_.generatePlan(parse_statement)));
 }
 
 }  // namespace optimizer

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/15d2cbd6/query_optimizer/Optimizer.hpp
----------------------------------------------------------------------
diff --git a/query_optimizer/Optimizer.hpp b/query_optimizer/Optimizer.hpp
index 18c927d..f90fbe4 100644
--- a/query_optimizer/Optimizer.hpp
+++ b/query_optimizer/Optimizer.hpp
@@ -18,7 +18,9 @@
 #ifndef QUICKSTEP_QUERY_OPTIMIZER_OPTIMIZER_HPP_
 #define QUICKSTEP_QUERY_OPTIMIZER_OPTIMIZER_HPP_
 
+#include "query_optimizer/LogicalGenerator.hpp"
 #include "query_optimizer/OptimizerContext.hpp"
+#include "query_optimizer/PhysicalGenerator.hpp"
 #include "utility/Macros.hpp"
 
 namespace quickstep {
@@ -48,7 +50,8 @@ class Optimizer {
    */
   Optimizer(CatalogDatabase *database,
             StorageManager *storage_manager)
-      : optimizer_context_(database, storage_manager) {}
+      : optimizer_context_(database, storage_manager),
+        logical_generator_(&optimizer_context_) {}
 
   /**
    * @brief Destructor.
@@ -77,6 +80,8 @@ class Optimizer {
 
  private:
   OptimizerContext optimizer_context_;
+  LogicalGenerator logical_generator_;
+  PhysicalGenerator physical_generator_;
 
   DISALLOW_COPY_AND_ASSIGN(Optimizer);
 };


Mime
View raw message