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: update
Date Fri, 22 Jul 2016 07:08:36 GMT
Repository: incubator-quickstep
Updated Branches:
  refs/heads/fix-vs-adaptive-bloom-filters a0bca3501 -> d206d712a


update


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

Branch: refs/heads/fix-vs-adaptive-bloom-filters
Commit: d206d712a31484c305341e5d282b8a370fd19b2d
Parents: a0bca35
Author: Jianqiao Zhu <jianqiao@cs.wisc.edu>
Authored: Fri Jul 22 02:08:28 2016 -0500
Committer: Jianqiao Zhu <jianqiao@cs.wisc.edu>
Committed: Fri Jul 22 02:08:28 2016 -0500

----------------------------------------------------------------------
 query_optimizer/ExecutionHeuristics.cpp   |  6 +++---
 relational_operators/HashJoinOperator.cpp |  2 +-
 storage/HashTable.hpp                     | 10 ++++++++--
 utility/BloomFilterAdapter.hpp            | 10 +++++-----
 4 files changed, 17 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/d206d712/query_optimizer/ExecutionHeuristics.cpp
----------------------------------------------------------------------
diff --git a/query_optimizer/ExecutionHeuristics.cpp b/query_optimizer/ExecutionHeuristics.cpp
index ed49881..b1aad0f 100644
--- a/query_optimizer/ExecutionHeuristics.cpp
+++ b/query_optimizer/ExecutionHeuristics.cpp
@@ -78,9 +78,9 @@ void ExecutionHeuristics::optimizeExecutionPlan(QueryPlan *query_plan,
       std::unordered_map<QueryContext::bloom_filter_id, std::vector<attribute_id>>
probe_bloom_filter_info;
       std::vector<QueryContext::bloom_filter_id> bloom_filter_ids;
       for (const std::size_t node : chained_nodes) {
-        if (!hash_joins_[node].is_selection_) {
-          continue;
-        }
+//        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();

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/d206d712/relational_operators/HashJoinOperator.cpp
----------------------------------------------------------------------
diff --git a/relational_operators/HashJoinOperator.cpp b/relational_operators/HashJoinOperator.cpp
index adf39bb..6188a40 100644
--- a/relational_operators/HashJoinOperator.cpp
+++ b/relational_operators/HashJoinOperator.cpp
@@ -61,7 +61,7 @@ namespace quickstep {
 
 DEFINE_int64(bloom_adapter_batch_size, 4000,
              "Number of tuples to probe in bulk in Bloom filter adapter.");
-DEFINE_bool(adapt_bloom_filter, true,
+DEFINE_bool(adapt_bloom_filters, true,
              "Whether to adaptively adjust the ordering of bloom filters.");
 
 namespace {

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/d206d712/storage/HashTable.hpp
----------------------------------------------------------------------
diff --git a/storage/HashTable.hpp b/storage/HashTable.hpp
index f1aeda4..f5bc945 100644
--- a/storage/HashTable.hpp
+++ b/storage/HashTable.hpp
@@ -2290,10 +2290,16 @@ void HashTable<ValueT, resizable, serializable, force_key_copy,
allow_duplicate_
         std::uint32_t batch_size =
             batch_size_try > num_tuples_left ? batch_size_try : num_tuples_left;
         batch.reserve(batch_size);
-        while (batch.size() < batch_size && accessor->next())
+        while (batch.size() < batch_size && accessor->next()) {
           batch.push_back(accessor->getCurrentPosition());
+        }
 
-        std::size_t num_hits = bloom_filter_adapter->bulkProbe(accessor, batch);
+        std::size_t num_hits;
+        if (FLAGS_adapt_bloom_filters) {
+          num_hits = bloom_filter_adapter->bulkProbe<true>(accessor, batch);
+        } else {
+          num_hits = bloom_filter_adapter->bulkProbe<false>(accessor, batch);
+        }
 
         for (std::size_t t = 0; t < num_hits; ++t){
           tuple_id probe_tid = batch[t];

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/d206d712/utility/BloomFilterAdapter.hpp
----------------------------------------------------------------------
diff --git a/utility/BloomFilterAdapter.hpp b/utility/BloomFilterAdapter.hpp
index 9ed4065..03e2c37 100644
--- a/utility/BloomFilterAdapter.hpp
+++ b/utility/BloomFilterAdapter.hpp
@@ -58,8 +58,8 @@ class BloomFilterAdapter {
       delete entry;
   }
 
-  template <typename ValueAccessorT, bool adapt_filters = true>
-  inline std::size_t bulkProbe(
+  template <bool adapt_filters, typename ValueAccessorT>
+  std::size_t bulkProbe(
       const ValueAccessorT *accessor,
       std::vector<tuple_id> &batch) {
     std::size_t out_size = batch.size();
@@ -85,7 +85,7 @@ class BloomFilterAdapter {
           cnt(0) {
     }
 
-    static inline bool isBetterThan(const BloomFilterEntry *a,
+    static bool isBetterThan(const BloomFilterEntry *a,
                              const BloomFilterEntry *b) {
       return a->miss_rate > b->miss_rate;
       // return static_cast<std::uint64_t>(a.miss) * b.cnt
@@ -101,7 +101,7 @@ class BloomFilterAdapter {
   };
 
   template <typename ValueAccessorT, bool adapt_filters = true>
-  inline std::size_t bulkProbeBloomFilterEntry(
+  std::size_t bulkProbeBloomFilterEntry(
       BloomFilterEntry &entry,
       const ValueAccessorT *accessor,
       std::vector<tuple_id> &batch,
@@ -129,7 +129,7 @@ class BloomFilterAdapter {
     return out_size;
   }
 
-  inline void adaptEntryOrder() {
+  void adaptEntryOrder() {
     for (auto &entry : bloom_filter_entries_)
       entry->miss_rate = static_cast<float>(entry->miss) / entry->cnt;
     std::sort(bloom_filter_entries_.begin(),


Mime
View raw message