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

Re: Multiple index for a node



Ervin Hegedüs wrote:
> is there any way to use multiple keys for a node in a LPD tree?
> 
> I mean, there are several subtree-s:
> ou=company2,dc=foo,dc=com
> 
> and I have to store the users under these subtrees.

Are these two subtrees within the same database?
Or do you have separate databases with the suffixes above?

Which search base do your LDAP clients use?
dc=foo,dc=com or ou=companyX,dc=foo,dc=com?

> Sometimes the users
> have same names, eg. John Smith, and the nodes will be:
> 
> uid=jsmith,ou=company1,dc=foo,dc=com
> uid=jsmith,ou=company2,dc=foo,dc=com
> 
> but the any other attributes (sn, cn, ...) also the same.
> 
> How do I set up the indexes?

I'm not sure whether I really understand your issue.

An index just speeds up a lookup for a small search candidate set.

Example:

Assuming you have a single database with suffix dc=foo,dc=com and
sub-trees ou=companyX,dc=foo,dc=com:

index uid eq

Using search base dc=foo,dc=com there will be two results returned for
filter "(uid=jsmith)". But indeed the lookup will be faster because uid
is indexed.

Off course a typical LDAP-based "login" will fail because there are two
search results returned and therefore the uid->DN mapping is not unique.

In general indexes defined for several assertion attributes used in a
filter are used. But note that search performance can be worse if you're
indexing attributes with same values in many entries.

Ciao, Michael.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature