You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@quickstep.apache.org by na...@apache.org on 2016/07/11 17:28:56 UTC

[4/5] incubator-quickstep git commit: Print out bloom filter hit/miss stats

Print out bloom filter hit/miss stats


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

Branch: refs/heads/expt_bloom_filter
Commit: f6eeb3586757a6c56958e73ffddd5df435379575
Parents: fdaed15
Author: Navneet Potti <na...@gmail.com>
Authored: Sun Jul 10 16:55:13 2016 -0500
Committer: Navneet Potti <na...@cs.wisc.edu>
Committed: Mon Jul 11 12:28:25 2016 -0500

----------------------------------------------------------------------
 storage/HashTable.hpp | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/f6eeb358/storage/HashTable.hpp
----------------------------------------------------------------------
diff --git a/storage/HashTable.hpp b/storage/HashTable.hpp
index 740e678..2100430 100644
--- a/storage/HashTable.hpp
+++ b/storage/HashTable.hpp
@@ -2231,6 +2231,7 @@ inline std::size_t HashTable<ValueT, resizable, serializable, force_key_copy, al
   }
 }
 
+
 template <typename ValueT,
           bool resizable,
           bool serializable,
@@ -2253,8 +2254,12 @@ void HashTable<ValueT, resizable, serializable, force_key_copy, allow_duplicate_
       bloom_filter_adapter.reset(
           new BloomFilterAdapter(probe_bloom_filters_, probe_attribute_ids_));
     }
+    std::size_t numFalsePositives = 0;
+    std::size_t numMisses = 0;
+    std::size_t numHits = 0;
     while (accessor->next()) {
       if (has_probe_side_bloom_filter_ && bloom_filter_adapter->miss(accessor)) {
+        numMisses++;
         continue;  // On a bloom filter miss, probing the hash table can be skipped.
       }
 
@@ -2268,13 +2273,23 @@ void HashTable<ValueT, resizable, serializable, force_key_copy, allow_duplicate_
                                                                : true_hash;
       std::size_t entry_num = 0;
       const ValueT *value;
+      bool wasHit = false;
       while (this->getNextEntryForKey(key, adjusted_hash, &value, &entry_num)) {
+        wasHit = true;
         (*functor)(*accessor, *value);
         if (!allow_duplicate_keys) {
           break;
         }
       }
+      if (!wasHit)
+        numFalsePositives++;
+      else
+        numHits++;
+
     }
+    std::cerr << "numFalsePositives: " << numFalsePositives
+              << " numMisses: " << numMisses
+              << " numHits: " << numHits << "\n";
   });
 }