Bug 1011539

Summary: [RFE] idlistscanlimit per index/type/value
Product: Red Hat Enterprise Linux 7 Reporter: Rich Megginson <rmeggins>
Component: 389-ds-baseAssignee: Rich Megginson <rmeggins>
Status: CLOSED CURRENTRELEASE QA Contact: Sankar Ramalingam <sramling>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 7.0CC: jgalipea, nkinder
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 389-ds-base-1.3.1.6-5.el7 Doc Type: Enhancement
Doc Text:
Cause: Consequence: Fix: Result:
Story Points: ---
Clone Of: 1004876 Environment:
Last Closed: 2014-06-13 10:37:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1004876    
Bug Blocks:    

Description Rich Megginson 2013-09-24 13:51:18 UTC
+++ This bug was initially created as a clone of Bug #1004876 +++

This bug is created as a clone of upstream ticket:
https://fedorahosted.org/389/ticket/47504

With very large databases, some queries go through a lot of work to build huge ID lists for filter components with many matching IDs.  For example, a search for (&(objectclass=inetorgperson)(uid=foo)) may build a huge idlist for objectclass=inetorgperson only to throw it away to intersect it with uid=foo.  In these cases, it would be useful to be able to tell the indexing code to use a different idlistscanlimit for certain indexes, or use no idlist at all.  In the above case, it would be useful to tell the indexing code to skip building an idlist for objectclass=inetorgperson, but still use the default idlistscanlimit for other objectclass searches (e.g. objectclass=groupOfNames).

This would also help in https://fedorahosted.org/389/ticket/47474 - if there are several million IDs for each of the objectclass= filter components, being able to skip id list generation for the objectclass values would make that query very fast.

We can't reuse nsslapd-idlistscanlimit, so perhaps a new attribute

dn: cn=attrname,cn=index,...
objectclass: nsIndex
nsIndexIDSize: NNNN[:type][:eqvalue:eqvalue:...]

Where NNNN is the max ID list size (or 0 for no list at all)
type is the type of index (sub, pres, eq)
eqvalue are for equality indexes - these are the values to which the max ID list size applies

So in the case of ticket/47474, something like

dn: cn=objectclass,...
objectclass: nsIndex
nsIndexType: eq
nsIndexIDSize: 0:eq:organizationalPerson:inetOrgPerson:organization:organizationalUnit:groupOf
Names:groupOfUniqueNames:group

Would effectively disable id list generation for the objectclass values listed.

Note that this will apply to _all_ queries for any of the objectclass values, not just their use in conjunction with this particular search filter.

Comment 1 Rich Megginson 2013-09-24 14:13:20 UTC
Upstream ticket:
https://fedorahosted.org/389/ticket/47504

Comment 2 Rich Megginson 2013-09-24 17:34:02 UTC
Tests:
------------------------------------------------------------------------
r8138 | rmeggins | 2013-09-24 11:32:56 -0600 (Tue, 24 Sep 2013) | 9 lines

Tests for the new feature Fine Grained ID List Size
new file filterscanlimit.sh tests have many positive and
negative tests to test features and error handling
tests pass with valgrind reporting no errors
upstream ticket - https://fedorahosted.org/389/ticket/47504

Comment 3 Sankar Ramalingam 2013-09-25 07:00:31 UTC
As per comment #2, the test cases are already automated in filter test suite. Hence, marking the qe_test_coverage+ flag.

Comment 5 Sankar Ramalingam 2013-12-20 13:33:12 UTC
Automated test cases in TET for filter test suites are PASSing. Hence, marking the bug as Verified.

Build tested - 389-ds-base-1.3.1.6-12

Snippets from the acceptance test report

added /tet/tet/../data/DS/6.0/filter/en/fslindexconfig-errors.21.ldif
added /tet/tet/../data/DS/6.0/filter/en/fslindexconfig-errors.22.ldif
TestCase [fsl1] result-> [PASS]

TestCase [fsl1] result-> [PASS]
Test fsl2 - test various combinations of filters and idlistscanlimit
loaded index config from /tet/tet/../data/DS/6.0/filter/en/fslindexconfig.ldif
modifying entry cn=config

TestCase [fsl2] result-> [PASS]

Comment 6 Ludek Smid 2014-06-13 10:37:02 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.