directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Lecharny (JIRA)" <>
Subject [jira] [Commented] (DIRSERVER-2162) Searcing for users using ObjectClass=person takes long
Date Mon, 08 Aug 2016 14:45:21 GMT


Emmanuel Lecharny commented on DIRSERVER-2162:

Is it {{(&(cn=PETEJO)(objectClass=person))}} or {{(&(cn=*PETEJO*)(objectClass=person))}}
? I suspect this is the second form (JIRA is formatting your input transforming the {{*PETEJO*}}
to {{PETEJO}} bold.)

So here, the *cn* filter selects almost all of your entries, which is due to the fact that
a search filter with {{*}} at both ends is treated as a full scan. In this case, what will
happen is that 21586 entries will be fetched from the disk, and it's going to be slow. I strongly
suggest you narrow the search.

One thing that might evolve on our side (bit not now) is that we may improve the substring
search, to create a better index that uses filters like {{(*petejo*)}}. This is what does
OpenLDAP, for instance, by creating an index for every set of N chars of every values. If
N is equal to 3, we will have an index for {{pet}}, {{ete}}, {{tej}}, {{ejo}}, so it will
be easy to find any entry which value containing {{petejo}} (or any consecutive triplets in
{{petejo}}, actually).

> Searcing for users using ObjectClass=person takes long
> ------------------------------------------------------
>                 Key: DIRSERVER-2162
>                 URL:
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 2.0.0-M20
>            Reporter: John Peter
> When we do the below query the result takes long. Around 10-50 seconds.
> Search base: ou=users,dc=xxx,dc=fi
> Filter (&(cn=*USERNAME*)(objectClass=person))
> Scope: Subtree
> However the below query returns the result immediately
> Search base: ou=users,dc=xxx,dc=fi
> Filter (&(cn=*USERNAME*)(objectClass=*))
> Scope: Subtree
> Looking at the Partition settings it has Indexed attributes ObjectClass and cn.
> First both queries took long. Then we added cn to the index and rebooted apacheDS and
the second query got fast.
> It seems like a bug that using ObjectClass in the query makes it slow all tough it is
in the index.
> It seems something similar was reported before DIRSERVER-2048, but it says it's fixed
in M20 which we are using.

This message was sent by Atlassian JIRA

View raw message