Rev 20: Handle when the only node is a leaf node in http://bzr.arbash-meinel.com/plugins/index2
John Arbash Meinel
john at arbash-meinel.com
Wed Jul 2 17:22:58 BST 2008
At http://bzr.arbash-meinel.com/plugins/index2
------------------------------------------------------------
revno: 20
revision-id: john at arbash-meinel.com-20080702162254-tgks103u1pyz2fl6
parent: john at arbash-meinel.com-20080702161654-vnxiym2kv1ygtxn6
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: index2
timestamp: Wed 2008-07-02 11:22:54 -0500
message:
Handle when the only node is a leaf node
-------------- next part --------------
=== modified file 'btree_index.py'
--- a/btree_index.py 2008-07-02 16:16:54 +0000
+++ b/btree_index.py 2008-07-02 16:22:54 +0000
@@ -562,8 +562,10 @@
if self._use_blooms:
global bloom_hits
- node = self._get_node(0)
- bloom_raw_offsets = node.bloom.get_raw_offsets(keys)
+ if len(self._row_lengths) > 1:
+ # no internal nodes, and thus no blooms in a length-1 b+tree.
+ node = self._get_node(0)
+ 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)
More information about the bazaar-commits
mailing list