我有一个需求,我需要像下面这样运行查询,并为满足该查询的所有实体获取2-3个属性。在单个查询中,distinguishedName的数量将在100左右。正如我在微软的documentation中看到的,distinguishedName没有索引,我怀疑这可能会导致性能问题。
有人知道这是否真的会导致性能问题吗?除了下面的ldap过滤器,我显然必须使用SUBTREE作用域。
(|(distinguishedName=<DN 1 goes here>)(distinguishedName=<DN 2 goes here>))编辑1:我在我的测试Active Directory中尝试了它,它有大约6k个条目。
Internal event: A client issued a search operation with the following options.
Starting node:
DC=example,DC=com
Filter:
( |
(distinguishedName=CN=user-1,CN=large-test,CN=Users,DC=example,DC=com)
(distinguishedName=CN=user-2,CN=large-test,CN=Users,DC=example,DC=com)
(distinguishedName=CN=user-3,CN=large-test,CN=Users,DC=example,DC=com)
(distinguishedName=CN=group1,CN=large-test,CN=Groups,DC=example,DC=com)
)
Search scope:
subtree
Attribute selection:
mail,objectClass
Server controls:
Visited entries:
4
Returned entries:
4
Used indexes:
idx_distinguishedName:4:N;idx_distinguishedName:1:N;idx_distinguishedName:1:N;idx_distinguishedName:1:N;
Pages referenced:
123
Pages read from disk:
0 从结果看,它似乎只访问了我使用一些索引搜索的4个条目。我检查了模式管理单元工具(只是为了确保),它没有显示distinguishedName上的索引。但不确定它是如何使用这些索引的。
发布于 2021-09-21 14:18:58
Microsoft Active Directory将组成员身份存储在入口级,因此您可以使用它来获取电子邮件属性。
例如,ldapsearch .... -b SEARCH_BASE "(|(memberOf=GROUP_DN_1)(memberOf=GROUP_DN_2)...)" mail
https://stackoverflow.com/questions/69265105
复制相似问题