In eDirectory, the Index Manager attribute, as the name suggests, acts as an database index manager to maximize the query performance of eDirectory. An attribute can be indexed to improve the performance of the queries involving the corresponding attribute. And there are a set of default indexes (indexed attributes) with every eDirectory installation. These attributes are nothing but the ones used mostly in eDirectory searches. The following are the automatically-indexed-attributes of eDirectory:
cn, dc, Given Name, surname, uniqueID, GUID, Aliased Object Name, ldapAttributeList, ldapClassList, obituary, member, reference, Equivalent to Me, NLS: Common Certificate, Revision, cn_SS, uniqueID_SS and extensionInfo.
And adding more to it, you have your own customized / customizable indexes as well. If you know that your enterprise uses a particular attribute in queries frequently, that specific attribute can be indexed.
iManager is a tool through which you can manage your indexes efficiently. Managing here means reading, creating, deleting and modifying the indexes.
Creating an index:
Taking an Index Offline:
In a production environment, to improve performance, there can be instances where you want to take indexes offline for a while. This is a common use case when a bulk load is being performed to the server (enabling indexes during bulk load may lower the bulk load performance). After the completion of the bulk load operation, the index can be brought back online.
Deleting an index:
Both the user defined and the default indexes can be deleted.
Indexes can be managed through LDAP as well. This article will explain how to manage indexes using LDIF files (and these LDIF files can used with any of the ldap utilities like ldapmodify, ICE, etc)
The steps would be as follows:
Writing the LDIF file:
You need to have a LDIF file with the LDAP attribute indexDefinition defined to modify an index.
To create and index,
To delete an index,
dn: cn=myserver, o=novell
So, note that the attribute indexDefinition is the key here and its syntax is as follows:
<Index Version>$<Index Name>$<Index State>$<Index Rule>$<Index Type>$<Index Value State>$<AttributeName>
The following appendix explains each of the index fields above.
This field is reserved for future use and the value of this field is zero(0) always.
Specifies the user defined name of the index. If this filed is empty, then the name of the attribute automatically becomes the name of the index. Note that '$' is a delimiter and hence this needs to be avoided in the name of the index.
Specifies the state of the index. It can have the following values:
eDirectory supports the following values:
0 - Denotes the 'suspended' state. This means that this index is not used in queried and not updated.
1 - Denotes the 'Bringing Online' state. This means that the index is in the process of being created. It has two states, Bringing Online (low) and Bringing online (high).
2 - Denotes the 'online' state, which indicates that the index is up and working.
3 – Denotes the 'Pending Creation' state, which indicates that the index has been defined and is waiting for the background process to run.
The background process changes the state after the building begins. Note that when defining an index, this field should be set to 2 (online).
The following can be the values of the 'Index Rule' field:
0 - Value Matching, which optimizes queries that involve the entire value or the first part of the value. For example, a query for all entries with a surname equal to Jensen or beginning with Jen.
1 - Presence Matching, which optimizes queries that involve only the presence of an attribute. For example, a query for all entries with a surname attribute.
2 - Substring Matching, which optimizes queries that involve a match of a few characters. For example, a query for all entries with a surname containing .der. This query returns entries with the surnames of Derington, Anderson, and Lauder.
Specifies who created the index. The following can be the values:
0 - User Defined
1 - Added on Attribute Creation
2 - Required for Operation
3 - System Index
When defining an index, this field has to be set to 0.
Index Value State:
Specifies the source of the index. eDirectory supports the following values:
0 - Uninitialized
1 - Added from Server
2 - Added from Local DIB
3 - Deleted from Local DIB
4 - Modified from Local DIB
When defining an index, set this field needs to be 1.
Specifies the NDS name(NOT THE LDAP NAME) of the attribute to be indexed.
Yes. Indexing improves search performance. But we have to keep in mind that updating the (modified) indexes will also consume a good amount of time, especially if the database is huge.