[ZODB-Dev] B-tree enhancement : interval search.

Vladimir Voznesensky vovic at smtp.ru
Thu Sep 4 16:48:58 EDT 2003


Hello.

I've realized one idea for Berkeley DB B-tree and I'm interested for the 
same thing in ZODB B-tree.
Imagine, that we have a B-tree of N-letters words sorted in alphabetical 
order.
Let's we need to find all the strings satisfying a specific template 
consisting of letters and "?" wildcards.
For example, a?b or ?c?.
The traditional approach for a?b is to find the first a?? word and 
iterate sequentially while first letter is a.
The traditional approach for ?c? is to iterate over all of words (or 
call [a-z]c searching for every letter in the alphabet).
Is it optimal? No.
In many cases we can eliminate some pages and some parts of pages, for 
example, [abc,aca] interval needs not to be checked for a?b. We can use 
real distribution of words in specific B-tree to accelerate searching.

I'm a new fellow in Zope. I'm ready to realize such an extention by 
myself, but I do not understand, how to organize my interaction with  
Zope folks: how to make feature requests, how to propagate my code, etc.
As for Berkeley DB, SleepyCat Software disagreed to add my feature to 
their source tree, because their customers are not interested in such 
extention.
My algorythm accelerates searching in many cases from times to 
magnitudes (depending on template and data variations) comparing to 
traditional approach of standard Berkeley DB API. I'd like to have and 
use the same thing in ZODB.
My feature can, for example, eliminate some limitations in Zope text 
indices.

Sorry for my English.
VV




More information about the ZODB-Dev mailing list