Indexing the Data Store

To Create or Modify Indexes  

196  

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.
Present - 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=ada*, for example). Substring indexing uses the first three letters of an attribute.
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
employeenumber is indexed by equality.
alias and nickname are indexed by presence, equality, approximate match and substring match.

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 Ldbm Data Store menu of the data store's property book (see "Maintaining the Data Store Attribute Indexes" on page 241). 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.


Note - Whenever you change the index directives in
/etc/opt/SUNWconn/ldap/current/slapd.conf, you must regenerate indexes using idxgen or the Graphical Administrative Interface, even if the indexed attributes have not yet been added to the database. Failure to do this may result in searches for existing, indexed, attributes to fail.

To regenerate indexes in a shell or script, you may use the idxgen(1M) command. The Directory Server should not be running when you are regenerating indexes.

 
/opt/SUNWconn/ldap/sbin/idxgen /var/opt/SUNWconn/ldap/current/dbm
 


 

To Create or Modify Indexes



AdminConsole>SUN Directory Services>LDAP Server property book>Index  

  1. In the Admin Console home page, click the Sun Directory Services icon to bring up the LDAP Server property book.
  2. Whether you are creating a new data store or modifying an existing one, click Index in the Sections list.
  New: Create/Ldbm Data Store->Index
  Existing: Data Store Section->double-click data store to modify->Index
  3. To add new attributes to be indexed in the database:
  a. Choose Index from the Create menu
  b. Specify the name of the indexed attribute and the index types
  You can specify several attributes separated by commas. These indexed attributes will have the same index types.
  c. Click Add to add the index.
  4. To modify existing indexing attributes:
  a. Double-click attribute to modify.
  b. Check the parameters on which to index and click Modify.



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