[ZODB-Dev] n-way join algoritms

Roché Compaan roche at upfrontsystems.co.za
Sun Jun 22 12:47:24 EDT 2003


* Phillip J. Eby <pje at telecommunity.com> [2003-06-22 00:13]:
> I don't understand what you're saying.  But, the basic merge algorithm for 
> joining is trivial.  All of the complexity of joining comes from 
> optimization.
> 
> The most trivial algorithm would look like this:
> 
> for a in A:
>     for b in B:
>         if a.x == b.x:
>             for c in C:
>                 if b.y==c.y:
>                     for d in D:
>                         if c.z==d.z:
>                             yield a,b,c,d

Thanks Phillip this will work perfectly. I already have a filtered
result per class and there are indexes for all the joins available so it
should be quite fast.

-- 
Roché Compaan
Upfront Systems                 http://www.upfrontsystems.co.za



More information about the ZODB-Dev mailing list