[ZODB-Dev] Updated BTree docs

Casey Duncan casey at zope.com
Fri May 2 10:57:46 EDT 2003


I think I can elaborate on the following passage in the docs:

"...which find the minimum and maximum key value subject to an optional bound 
argument, and byValue(), which should probably be ignored (it's hard to 
explain exactly what it does, and as a result it's almost never used - best 
to consider it deprecated). "

byValue() returns (value, key) pairs in sorted order by value. ZCatalog uses 
this to sort "scored" results, such as from text indexes, which start as a 
mapping of rid->score.

I have actually been camping on some optimized code for this. The current 
implementation is pretty lame. I came up with a new API, keysByValue(), which 
returns the keys in order by value, which is really all ZCatalog needs. The 
implementation I have for *IBTree variants is 10x faster than the existing 
byValue implementation.

I should probably get with you and/or Jim and discuss generalizing this and 
integrating it into the BTrees module. Basically I need to make it work for 
*OBTree variants and tangle it up with the macros in there.

-Casey


On Thursday 01 May 2003 05:01 pm, Tim Peters wrote:
> Because the secret requirements for what you can get away with in objects
> used as BTree/Bucket keys (TreeSet/Set elements) keep getting violated for
> some reason <wink>, Jeremy & I conspired to make some new docs appear:
> 
>     http://www.zope.org/Wikis/ZODB/guide/zodb.html
> 
> Section 5.3 (BTrees Package) has been updated, and section 5.3.1 (Total
> Ordering and Persistence) is new.  This is definitely an area where an ounce
> of prevention is better than three days of debugging pain, so give it a
> read!
> 
> 
> _______________________________________________
> For more information about ZODB, see the ZODB Wiki:
> http://www.zope.org/Wikis/ZODB/
> 
> ZODB-Dev mailing list  -  ZODB-Dev at zope.org
> http://mail.zope.org/mailman/listinfo/zodb-dev
> 




More information about the ZODB-Dev mailing list