A data store can contain a number of attribute indexes to help optimize the speed of access to directory information. An attribute index is a list of entries containing a given attribute or attribute value. You can index attributes using any of the following matching rules:
Equality - Optimizes direct access to entries where an exact attribute value is supplied.
Presence - Optimizes searches with filters specifying the presence of an attribute but no specific value (cn=*, for example).
Substring - Optimizes searches with filters containing a partially-specified attribute value (cn=adr*, for example). Substring indexing uses all possible combinations of three successive letters. For example, if cn=adrianne, the substring indexes are: adr, dri, ria, ian, ann, nne. This type of index is longer to generate and is the most costly in terms of disk space.
Approximate - Optimizes searches with approximate match filters. The method used in approximate indexing is to discard vowels.
In a data store having the default characteristics, the following attributes are indexed:
commonName, surname, mail, mailHost, and givenName are indexed by presence, equality, approximate match and substring match
uid is indexed by presence and equality
preferredRfc822Recipient, rfc822Mailbox, cCMailAddress, pROFSAddresses, mSMailAddresses are indexed by presence and equality
The advantage of indexing is that it optimizes access for indexed attributes. The disadvantages are that it uses more disk space, and that adding and modifying entries takes longer.
When you add or modify an entry after an index has been created, the index is automatically updated. However, if you create a new index and the data store already contains entries, those entries are not automatically included in the index. Indexes are not automatically updated when entries are removed from the directory, so the size of the index files does not reduce as entries are removed.
To update all the indexes defined in a data store, choose Refresh Index from the Data Store menu of the data store window (see "Directory Maintenance".) Regenerating the indexes for a data store can take several minutes, depending on the number and complexity of the indexes defined. For example, regenerating the default indexes for a data store of 20,000 entries takes approximately five minutes.
Whether you are creating a new data store or modifying an existing one, select Index from the Create menu.
The Add Index window is displayed.
Specify the name of the indexed attribute and the index types.
Use the Set button to select attributes from a list. You can specify several attributes separated by commas. These indexed attributes will have the same index types.
Click Apply to add the index.