In Active Directory, using specific filtering criteria can boost search performance. This is because Active Directory evaluates all predicates, identifies the indices, and then selects one index likely to yield the smallest set of returned values.
Avoid searching for text in the middle or the end of a string, for example, "cn=*hille*" or "cn=*larouse".
When possible, search for indexed attributes. Indexed attributes are stored on all domain controllers, so the query will most likely be faster than searching for a non-indexed attribute.
Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
