Important critical indexes

The Directory Server has several built-in indexes on the local DB backend that are critical to internal server processing and should never be removed.

aci, ds-entry-unique-id, objectClass

Built-in indexes for efficient queries

The Directory Server has built-in indexes on the local DB backend. Internal processing of the server relies on the aci, ds-soft-delete-from-dn, ds-soft-delete-timestamp, entryUUID, member, objectClass, and uniqueMember indexes, which must not be removed. You can remove the mail and uid indexes, but these attributes are referenced from the Password Modify Extended Operation and their removal causes problems with components, such as the Exact Match Identity Mapper. If you remove the mail or uid indexes, additional configuration changes might be necessary to ensure that the server starts properly. You can safely remove the cn, givenName, mail, sn, and telephoneNumber indexes if clients do not query on these attributes. This reduces the size of the database both on disk and in memory.

Online rebuilds

When an online index rebuild is in progress, the data in that backend is available and writable although the index being rebuilt is not used. Searches that attempt to use that attribute might be unindexed.

Index rebuild administrative alert

The Directory Server generates an administrative alert when the rebuild process begins and ends. It has a degraded-alert-type of index-rebuild-in-progress so that a Directory Proxy Server, such as the Directory Server can avoid using that server while the rebuild is in progress.

System indexes cannot be rebuilt

The contents of the backend must be exported and re-imported in order to rebuild system indexes. For more information, see the list of System indexes.

Indexing certain attributes

Ensure that the following recommendations are used when setting up the indexes:

  • Do not use equality and substring indexes for attributes that contain binary data.
  • Avoid approximate indexes for attributes containing numbers, such as telephone numbers.

Unindexed searches

Unindexed attributes result in longer search times as the database itself has to be searched instead of the database index file. Only users with the unindexed-search privilege are allowed to carry out unindexed searches. In general, you should prevent applications from performing unindexed searches so that searches that are not indexed would be rejected rather than tying up a worker thread. Ways to achieve this include the following:

  • Make sure that only the absolute minimum set of users have the unindexed-search privilege. This privilege can be used without any other restrictions.
  • To allow unindexed searches with some control, the Permit Unindexed Search request control can be used with the unindexed-search-with-control privilege. With this privilege, a user is only permitted to request an unindexed search if the search request includes the Permit Unindexed Search request control. The unindexed-search privilege allows a client to request an unindexed search without this control.
  • You can use the Reject Unindexed Search request control to explicitly indicate that a client does not want the server to process an unindexed search request, regardless of privileges. For information about these controls, see the LDAP SDK. These capabilities are also available with the ldapsearch tool.
  • Make sure that allow-unindexed-searches property is set to false in all client connection policies, in which unindexed searches should never be necessary. If the client connection policy should allow undindexed searches, set the allow-unindexed-searches-with-control property to true. If allow-unindexed-searches is false but, allow-unindexed-searches-with-control is true, the policy only permits an unindexed search if the request includes the Permit Unindexed Search request control. For more information, see the LDAP SDK and the ldapsearch tool.
  • Set a nonzero value for the maximum-concurrent-unindexed-searches global configuration property to ensure that if unindexed searches are allowed, only a limited number of them are active at any given time. Administrators can configure the maximum number of concurrent unindexed searches by setting a property under Global Configuration.

    To change the maximum number of concurrent unindexed searches, use the dsconfig tool to set a value for the number. A default value of "0" represents no limit on the number of concurrent unindexed searches.

    $ bin/dsconfig set-global-configuration-prop \
      --set maximum-concurrent-unindexed-searches:2

Index entry limit

The Directory Server specifies an index entry limit property. This property defines the maximum number of entries that are allowed to match a given index key before it is no longer maintained by the server. If the index keys have reached this limit (default value is 4000), then you must rebuild the indexes using the rebuild-index tool. If an index entry limit value is set for the local DB backend, it overrides the value set for the overall JRE backend index entry limit configuration, such as 4000.

To change the default index entry limit, use the dsconfig tool, as in the following example.

$ bin/dsconfig set-local-db-index-prop --backend-name userRoot \
  --index-name cn --set index-entry-limit:5000

Rebuild index vs. full import

Expect a limited amount of database growth due to the existence of old data when running rebuild-index versus doing a full import of your database.