[Zope] Finding a match in a large dataset - btrees?

Andreas Jung lists at andreas-jung.com
Mon Dec 5 01:43:59 EST 2005



--On 5. Dezember 2005 16:57:03 +1300 Cameron Beattie <kjcsb at orcon.net.nz> 
wr> I've read a bit about btrees on the zope wiki and wonder if that's the
> best way. However I am struggling with the basics:
> 1. How do I get the data from MySQL into a btree in Zope? Something like:
> from BTrees.IIBTree import *
> t = IIBTree()
> t.update(context.select_from_LOCATION_MATCH) # errr, no

Reading helps:

<http://www.zope.org/Members/ajung/ZopeHomeOfAndreasJung/BTrees/FrontPage>

>
> 2. How do I find the matching node i.e. when I want to know that 6422
> relates to location_id 15?
>

I still have no idea what your example should tell me. A BTree basically
implements the same API as a Python dictionary. If you can implement your 
solution in pure Python then you can just switch to BTrees. But I have no 
idea about your example especially BTrees implement a 1:1
relationship (when using an IIBTree).

-aj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20051205/e0f646d6/attachment.bin


More information about the Zope mailing list