Service manual
Tuning Indexing for Performance
Chapter 7 Tuning Indexing 135
$ ldapmodify -h host -p port -D "cn=directory manager" -w password
dn: cn=example,cn=ldbm database, cn=plugins, cn=config
changetype: modify
replace: nsslapd-require-index
nsslapd-require-index: on
^D (^Z on Windows systems)
The change takes effect immediately. No need to restart Directory Server.
Limiting Index List Length
In large and fast growing directory deployments, indexing may reach the point of
diminishing returns for a particular index key. At the point of diminishing returns,
the list associated with a particular key becomes so long that maintaining the list
costs more than performing an occasional unindexed search on that particular key
for candidate entries. Imagine for example a very large phone book application
equality indexed on surname. Imagine the number of Smiths in the phone book is
so large that maintaining an index for Smiths outweighs the lookup benefits. At
this point, Directory Server should stop indexing surname for Smith. Directory
Server should, however, continue indexing for other surnames.
Directory Server has a mechanism for handling this. You set a configuration
attributeto a threshold value. If the numberofentries inthelist for a particularkey
gets as large as the value you set, Directory Server replaces the list for the key with
a token specifying that an unindexed searchshould be performed to findcandidate
entries for that particularkey. The value is somewhere near but less than the value
for the maximum number of candidate entries checked for a search, set using
nsslapd-lookthroughlimit, as described in Table 9-1 on page 150.
The mechanism is referred to as the all IDs threshold, named after the configuration
attribute used to set the global threshold value,
nsslapd-allidsthreshold on
cn=config,cn=ldbm database,cn=plugins,cn=config. Notice this value is
currently globalto the Directory Server instance. It cannot be set differently for
different indexes.
Figure 7-5 illustrates the example of indexing on surname with a number of Smiths
greater than
nsslapd-allidsthreshold.