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

Re: Index for objectclass does not work...



2011/1/4 Quanah Gibson-Mount <quanah@zimbra.com>:
> --On Tuesday, January 04, 2011 1:43 AM +0100 Steeg Carson
> <steeg.carson@googlemail.com> wrote:
>
>> I simulate this on my database just right now:
>
> I suggest you read:
>
> <http://www.openldap.org/lists/openldap-technical/201011/msg00146.html>
>
> to understand how indices and their slots work.
>

As I now understand, the entire index for one attribute (e.g.
objectClass) is "split" in several indexes. They holds for each
path/node (resp. DN, but not leaf) an separate index for this
attribute with all "hits" for his subtree (and for onelevel too).

If I do an ldapsearch with -b "cn=ownPath,ou=root" the slapd takes the
index which is bound on this node/DN?

In my DIT are 470812 entires.

The objectClass=subEngine exists 104384 times in the entire directory (ou=root).
The objectClass=subEngine exists only 1 time under  "cn=ownPath,ou=root",

The following test I made with BDB, because each node holds an index
for subtree and one for onelevel (hdb only for onelevel)

When I search (loglevel 33):

ldapsearch -x -h localhost -wpassword  -D"uid=admin,ou=root"
-b"cn=ownPath,ou=root" "(ObjectClass=subEngine)"

I get in the logfile:
================================================
=> key_read
<= bdb_index_read 470601 candidates
<= bdb_equality_candidates: id=-1, first=228, last=470828
<= bdb_filter_candidates: id=-1 first=228 last=470828
<= bdb_list_candidates: id=-1 first=228 last=470828
<= bdb_filter_candidates: id=-1 first=228 last=470828
<= bdb_list_candidates: id=-1 first=40595 last=470825
<= bdb_filter_candidates: id=-1 first=40595 last=470825
bdb_search_candidates: id=-1 first=40595 last=470825
=> test_filter
   EQUALITY
<= test_filter 5
bdb_search: 40595 does not match filter
.
.
.

================================================.
.
Should the index at this level not hold only one entry:

ldapsearch -x -h localhost -wpassword  -D"uid=admin,ou=root"
-b"cn=ownPath,ou=root" "(ObjectClass=subEngine)" dn | grep "^dn:" | wc -l
1

thanks Steeg!