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

Re: how to speed up filtering of dn's

On Thu, 2012-12-06 at 15:52 +0100, Hallvard Breien Furuseth wrote:
> Hanspeter Kunz writes:
> > I want to find all entries in my ldap directory that contain certain
> > ou's, e.g.
> > 
> > ldapsearch -x "(ou:dn:=Administration)"
> > 
> > which returns (in my case) all entries that correspond to administrative
> > staff. The query works but it is slow and puts a high load on the ldap
> > server. 
> > 
> > I wonder if I can create an index which would speed things up, but I
> > could not figure out what I should index.
> You can't.  

ok, bad, but good to know.

> You can index 'ou', search for each admin OU, and then issue
> one search request based on each returned DN.  The OU filter would be
> something like (&(ou=Administration)(ou:dn:=Administration)) or maybe
> (&(ou=Administration)(objectClass=organizationalUnit)(ou:dn:=Administration)).

I was thinking about this too. I just hoped that there is an elegant

actually the (ou:dn:=Administration) term is unnecessary, because this
is implied by (ou=Administration).

but thanks anyhow,