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

(ITS#8868) Inefficiency when processing certain search filters



Full_Name: Quanah Gibson-Mount
Version: 2.4.46
OS: Linux
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (47.208.148.239)


Certain search filters are not processed efficiently in the back-{bhm}db code
base.

An example is:

"(|(&(subscriberid=1)(objectClass=XYZ))(&(subscriberid=2)(objectClass=XYZ)))"

In this situation, the contiguous list of possibilities for the objectClass
result gets turned into a range, causing each entry to be examined as a match. 
This significantly increases CPU load and causes a delay in returning the
result.  Re-arranging the search in the following manner bypasses this issue:

(&(objectClass=XYZ)(|(subscriberid=1)(subscriberid=2)))"

General timing with back-mdb:

.477 seconds for the expensive search
.020 seconds for the optimized search

For back-bdb, the timing was:
.665 seconds for the expensive search
.020 seconds for the optimized search