The PingDirectory Server composite index can be generated from multiple pieces of information (a combination of multiple filter components, or a combination of filter components and a base DN). A composite index can also be based on only a single piece of information.

To improve searches over a large number of entries, equality composite indexes can be used to combine a mandatory equality filter pattern with an optional base DN pattern to improve the performance of searches in directories with a very large number of entries, and in particular with a very large number of non-leaf entries. Equality composite indexes offer two advantages over existing equality attribute indexes in these types of deployments.

Base DN Pattern - If a directory environment has many branches, but searches are often done that are within specific individual branches, the base DN pattern can be used to make search processing more efficient. The server will only need to search entries within a target branch.

For example, if the directory contains an “ou=Customers,dc=example,dc=com” branch, with a separate branches below that for sets of customers, like “ou=ACME,ou=Customers,dc=example,dc=com”, and “ou=SHOPCO,ou=Customers,dc=example,dc=com”, a composite index with a filter pattern of “(sn=?)” and a base DN pattern of “ou=?,ou=Customers,dc=example,dc=com” can be defined. Then a search with a filter of “(sn=Smith)” and a base DN of “ou=ACME,ou=Customers,dc=example,dc=com” can be used to narrow the search to the Smiths in the ACME branch.

Index Pages - If many entries have the same value for a specific attribute, composite indexes can break large ID sets up across multiple pages, unlike the traditional attribute index. Using the previous example, if a search of the directory returns 50,000 Smiths, the results can be served in blocks of 5,000 IDs. An attribute index will return either one Smith record whose value is a block that contains all 50,000 of the matching entry IDs (if the index isn’t exploded), or 50,000 Smith records that each have a value of the matching entry ID (when the index is exploded). The non-exploded form is efficient for searching because all of the entry IDs are returned in a single read, but it’s expensive for writing because if a Smith must be added or removed, the entire block of 50,000 entry IDs must be rewritten. The exploded form is efficient for writing (adding or removing a Smith involves just that one entry ID), but it’s expensive for searching because it takes 50,000 reads to get all entry IDs for all of the Smiths.

Composite indexes break up the block of entry IDs across multiple pages (a page size of up to 5000). If the directory contains 50,000 Smiths, instead of having to choose between one block of 50,000 IDs or 50,000 blocks of one ID, ten blocks of 5,000 IDs are returned. This improves the efficiency of a read or write across many entries.

There is little performance overhead to the paging mechanism. Use an equality composite index for an attribute that has a lot of entries that have the same value (such as givenName or sn), not for an attribute with very few entries with the same value (such as id or mail). For attributes in which all of the values match a small number of entries, it’s better to use an equality attribute index.

When configuring a composite index, define the following properties:

Composite Index Properties Description
index-filter-pattern Specifies a single-valued filter property used to identify a portion of the index criteria. This can only be specified at the time that the index definition is created and is required.
index-base-dn-pattern Specifies a single-valued DN property that may indicate that the index should be scoped to a specific subtree or subtree pattern. This can only be specified at the time the index definition is created and is optional.