Optimize LDAP searches