[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Some openldap fixes... (fwd) (fwd)



You wrote:
> I for one would really like to see any changes that make
> the ldbm backend faster and more reliable.  Perhaps a more
> detailed explanation of your scoping algoritm?
> 
ok. peter made one:
OpenLDAP 1.2 index method:                                                                

relational table where:                                                                   
    tablename:  <attribute>                                                           
    key:        <prefix><value>                                                           
    data:       id-list of all elements that match:                                       
                    (<attribute>=<value>)                                                 

    algorithm:  return idl from key( <prefix><value>)                                    

our method:                                                                               

relational table where:                                                                   
    tablename:  <attribute>                                                         
    key:        <prefix><value>|reverse_string( <dn>)                                     
    data:       id-list of all elements that match:                                       
                    (<attribute>=<value>) && (<parent dn>=<dn>)             

    algorithm:                                                                           
        switch( scope)  {                                                                 
            case onelevel:                                                                
                return idl from key( <prefix><value>|string_reverse( <base dn>))          
                break;                                                                    

            case subtree:                                                                 
                return merged idls from                                                   
                    key( <prefix><value>|string_reversed( <base dn>*))                    
                // NOTE: due to the fact that B(+)trees have ordered keys                 
                // this is a linear key seq. starting on the key greater or
                // equal to the onelevel key. The iteration stops when the
                // keys don't start with the onelevel key anymore.
                break;
        }


It's blazingly fast...
But just try the patch ;)

-- 
Marijn@bitpit.net
---
Why is it illegal to park in a handicapped parking space but okay to
go the bathroom in a handicapped stall?