https://bugs.openldap.org/show_bug.cgi?id=9261
Bug ID: 9261 Summary: Slow subtree search when starting in large containers Product: OpenLDAP Version: 2.4.44 Hardware: x86_64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: --- Component: slapd Assignee: bugs@openldap.org Reporter: matthew.slowe@jisc.ac.uk Target Milestone: ---
Using "hdb" database type in slapd 2.4.44 on RedHat Enterprise Linux 7.8
When doing an indexed subtree search from a base which has a large number of objects the search result take considerably longer to find then starting "higher" in the tree.
For example:
dc=example,dc=org - 10 objects `- ou=test - 300,000 objects
Tests:
1. Search for (uid=username) basedn:dc=example,dc=org type:subtree 2. Search for (uid=username) basedn:ou=test,dc=example,dc=org type:subtree 3. Search for (uid=username) basedn:ou=test,dc=example,dc=org type:one
Expected results:
All three searches should be roughly the same given that "uid" has an equality index.
Actual results:
1. 0.1s 2. 5.5s 3. 0.1s
A debug trace excerpt of test (2) shows:
May 11 14:55:16 76ffcc7a2f29 slapd[1462]: conn=1000 op=1 SRCH base="ou=test,dc=example,dc=org" scope=2 deref=0 filter="(uid=username)" May 11 14:55:21 76ffcc7a2f29 slapd[1462]: 5eb96759 => bdb_filter_candidates