quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jianq...@apache.org
Subject incubator-quickstep git commit: Updates on avoiding bloom filters for non-selections
Date Wed, 20 Jul 2016 23:34:45 GMT
Repository: incubator-quickstep
Updated Branches:
  refs/heads/expt_bloom_filter_hash_fn 2cea4f76f -> bb90613d5


Updates on avoiding bloom filters for non-selections


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

Branch: refs/heads/expt_bloom_filter_hash_fn
Commit: bb90613d5da72ef0d2e62781c08b4276213812ea
Parents: 2cea4f7
Author: jianqiao <jianqiao@node-2.jianqiao.quickstep-pg0.wisc.cloudlab.us>
Authored: Wed Jul 20 18:33:52 2016 -0500
Committer: jianqiao <jianqiao@node-2.jianqiao.quickstep-pg0.wisc.cloudlab.us>
Committed: Wed Jul 20 18:33:52 2016 -0500

----------------------------------------------------------------------
 query_optimizer/ExecutionGenerator.cpp  | 4 ++--
 query_optimizer/ExecutionHeuristics.cpp | 6 +++++-
 query_optimizer/ExecutionHeuristics.hpp | 5 +++++
 3 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/bb90613d/query_optimizer/ExecutionGenerator.cpp
----------------------------------------------------------------------
diff --git a/query_optimizer/ExecutionGenerator.cpp b/query_optimizer/ExecutionGenerator.cpp
index 79bfcdb..aca0abe 100644
--- a/query_optimizer/ExecutionGenerator.cpp
+++ b/query_optimizer/ExecutionGenerator.cpp
@@ -842,8 +842,7 @@ void ExecutionGenerator::convertHashJoin(const P::HashJoinPtr &physical_plan)
{
   temporary_relation_info_vec_.emplace_back(join_operator_index, output_relation);
 
   // Add heuristics for the Hash Join, if enabled.
-  if (FLAGS_optimize_joins && !skip_hash_join_optimization
-      && build_physical->getPhysicalType() == P::PhysicalType::kSelection) {
+  if (FLAGS_optimize_joins && !skip_hash_join_optimization) {
     execution_heuristics_->addHashJoinInfo(build_operator_index,
                                            join_operator_index,
                                            referenced_stored_build_relation,
@@ -851,6 +850,7 @@ void ExecutionGenerator::convertHashJoin(const P::HashJoinPtr &physical_plan)
{
                                            std::move(build_original_attribute_ids),
                                            std::move(probe_original_attribute_ids),
                                            join_hash_table_index,
+                                           build_physical->getPhysicalType() == P::PhysicalType::kSelection,
                                            star_schema_cost_model_->estimateCardinality(build_physical));
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/bb90613d/query_optimizer/ExecutionHeuristics.cpp
----------------------------------------------------------------------
diff --git a/query_optimizer/ExecutionHeuristics.cpp b/query_optimizer/ExecutionHeuristics.cpp
index 6b30d83..2833066 100644
--- a/query_optimizer/ExecutionHeuristics.cpp
+++ b/query_optimizer/ExecutionHeuristics.cpp
@@ -73,8 +73,12 @@ void ExecutionHeuristics::optimizeExecutionPlan(QueryPlan *query_plan,
     if (chained_nodes.size() > 1) {
       std::unordered_map<QueryContext::bloom_filter_id, std::vector<attribute_id>>
probe_bloom_filter_info;
       for (const std::size_t node : chained_nodes) {
+        if (!hash_joins_[node].is_selection_) {
+          continue;
+        }
+
         // Provision for a new bloom filter to be used by the build operator.
-        const QueryContext::bloom_filter_id bloom_filter_id =  query_context_proto->bloom_filters_size();
+        const QueryContext::bloom_filter_id bloom_filter_id = query_context_proto->bloom_filters_size();
         serialization::BloomFilter *bloom_filter_proto = query_context_proto->add_bloom_filters();
 
         // Modify the bloom filter properties based on the statistics of the relation.

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/bb90613d/query_optimizer/ExecutionHeuristics.hpp
----------------------------------------------------------------------
diff --git a/query_optimizer/ExecutionHeuristics.hpp b/query_optimizer/ExecutionHeuristics.hpp
index 0f96ba6..788a1ac 100644
--- a/query_optimizer/ExecutionHeuristics.hpp
+++ b/query_optimizer/ExecutionHeuristics.hpp
@@ -68,6 +68,7 @@ class ExecutionHeuristics {
                  std::vector<attribute_id> &&build_attributes,
                  std::vector<attribute_id> &&probe_attributes,
                  const QueryContext::join_hash_table_id join_hash_table_id,
+                 const bool is_selection,
                  const std::size_t estimated_build_relation_cardinality)
         : build_operator_index_(build_operator_index),
           join_operator_index_(join_operator_index),
@@ -76,6 +77,7 @@ class ExecutionHeuristics {
           build_attributes_(std::move(build_attributes)),
           probe_attributes_(std::move(probe_attributes)),
           join_hash_table_id_(join_hash_table_id),
+          is_selection_(is_selection),
           estimated_build_relation_cardinality_(estimated_build_relation_cardinality) {
     }
 
@@ -86,6 +88,7 @@ class ExecutionHeuristics {
     const std::vector<attribute_id> build_attributes_;
     const std::vector<attribute_id> probe_attributes_;
     const QueryContext::join_hash_table_id join_hash_table_id_;
+    const bool is_selection_;
     const std::size_t estimated_build_relation_cardinality_;
   };
 
@@ -115,6 +118,7 @@ class ExecutionHeuristics {
                               std::vector<attribute_id> &&build_attributes,
                               std::vector<attribute_id> &&probe_attributes,
                               const QueryContext::join_hash_table_id join_hash_table_id,
+                              const bool is_selection,
                               const std::size_t estimated_build_relation_cardinality) {
     hash_joins_.push_back(HashJoinInfo(build_operator_index,
                                        join_operator_index,
@@ -123,6 +127,7 @@ class ExecutionHeuristics {
                                        std::move(build_attributes),
                                        std::move(probe_attributes),
                                        join_hash_table_id,
+                                       is_selection,
                                        estimated_build_relation_cardinality));
   }
 


Mime
View raw message