directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lécharny <>
Subject Re: Is it faster/better to include one objectclass or all in query?
Date Wed, 14 Mar 2012 16:10:46 GMT
Le 3/14/12 4:18 PM, a écrit :
> Emmanuel, thank you.  One follow-up and I should have included this in the original message.
 My query includes an OU as the base dn in the search.
> All entries in this OU all have the same 4 objectclass values. No other objectclass types
are in this particular OU.
> Say I had 1000 entries. Each count for top, person, organizationalPerson and inetOrgperson
would all yield 1000 hits. In this case, should I include the objectclass in the query at

If you start your search from a given baseDN, and if there is no 
children, then there is no need to use any (objectClass=XXX) in your 
filter, as it will match all the entries at this level. And as we use a 
special index for searches starting at a position in the DIT, it's enough.

You have 3 specific index that I have not talked about :
- ONE_LEVEL index, which is used to select all the entries from a 
position in the DIT, plus all theirs direct children (excluding the 
- SUB_LEVEL index, which selects all the descendant entries from a 
position, except the given base DN
- RDN index : which is internally use to browse the DIT

If you have specified a baseDN, and a scope (default is SUBTREE), those 
index will be used anyway.

Emmanuel Lécharny

View raw message