Indexing

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 that contains 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 specifying a partially specified attribute value (cn=ad*, for example)
Approximate
  Optimizes searches with approximate match filters; an approximate match index is the most expensive in terms of disk space

By default, the following attributes are indexed:

commonName, surname, mail, and mailServer are indexed by presence, equality, approximate match, and substring match.
uid is 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 is not reduced as entries are removed. Recreating the indexes for a data store can take several minutes, depending on the number and complexity of the indexes defined. For example, recreating the default indexes for a data store of 20,000 entries takes approximately five minutes.




Copyright © 1999 Sun Microsystems, Inc. All Rights Reserved.