How can I determine if a given search is using an index?
Unindexed searches can be seen in the directory server access log. The unindexed search indicator indicates that the search performed was unindexed, which means that the database itself had to be directly searched instead of the index file. This is much slower than doing an indexed search. Unindexed searches occur either when the All IDs Threshold was reached within the index file used for the search, when no index file existed, or when the index file was not configured in the way required by the search.
[24/Apr/2012:11:10:20 -0400] conn=24 fd=64 slot=64 connection from 192.168.122.155 to 192.168.122.240
[24/Apr/2012:11:10:20 -0400] conn=24 op=0 BIND dn="" method=128 version=3
[24/Apr/2012:11:10:20 -0400] conn=24 op=0 RESULT err=0 tag=97 nentries=0 etime=0 dn=""
[24/Apr/2012:11:10:20 -0400] conn=24 op=1 SRCH base="dc=example,dc=com" scope=2 filter="(uid=*)" attrs=ALL
[24/Apr/2012:11:10:38 -0400] conn=24 op=1 RESULT err=11 tag=101 nentries=0 etime=18 notes=U
[24/Apr/2012:11:10:38 -0400] conn=24 op=-1 fd=64 closed - B1
In the above logs, the notes=U
at the end of the fifth line indicates it is un-indexed.
Thanks to Arpit Tolani of Red Hat support for his help with this.