Rev 19: Start using the raw offsets when iterating. in http://bzr.arbash-meinel.com/plugins/index2

John Arbash Meinel john at arbash-meinel.com
Wed Jul 2 17:16:58 BST 2008


At http://bzr.arbash-meinel.com/plugins/index2

------------------------------------------------------------
revno: 19
revision-id: john at arbash-meinel.com-20080702161654-vnxiym2kv1ygtxn6
parent: john at arbash-meinel.com-20080702161204-uvj9yxiq464wngc0
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: index2
timestamp: Wed 2008-07-02 11:16:54 -0500
message:
  Start using the raw offsets when iterating.
-------------- next part --------------
=== modified file 'btree_index.py'
--- a/btree_index.py	2008-07-02 16:08:22 +0000
+++ b/btree_index.py	2008-07-02 16:16:54 +0000
@@ -561,10 +561,9 @@
         row_offset = 0
 
         if self._use_blooms:
+            global bloom_hits
             node = self._get_node(0)
-            bloom_raw_offsets = {}
-            for key in keys:
-                bloom_raw_offsets[key] = node.bloom.get_raw_offsets_for_key(key)
+            bloom_raw_offsets = node.bloom.get_raw_offsets(keys)
         for row_length in self._row_lengths[:-1]:
             node_indexes = [idx for idx, s_keys in nodes_and_keys]
             nodes = self._get_nodes(node_indexes)
@@ -577,8 +576,7 @@
                 if self._use_blooms and node.bloom is not None:
                     # If using blooms, filter out any nodes that don't hit.
                     remaining_sub_keys = [sub_key for sub_key in sub_keys
-                                          if '\x00'.join(sub_key) in node.bloom]
-                    global bloom_hits
+                        if node.bloom.contains_raw_offset(bloom_raw_offsets[sub_key])]
                     bloom_hits += len(sub_keys) - len(remaining_sub_keys)
                     sub_keys = remaining_sub_keys
                 if isinstance(sub_keys, frozenset):



More information about the bazaar-commits mailing list