How to count the number of entries matched by a LDAP query without retrieving the records?
I am trying several different LDAP filters on a big set of entries and for performance reasons I want to know only the number of returned entries, not to get them all.
Is this possible, how?
No. The LDAP protocol does not provide support for counting. A server implementation could provide this information via an supportedControl or supportedExtension or some other "Feature", but I do not know of any that do this.
UnboundID's SDK can perform the search and provide a searchResult count, but the search has to be completed before the count is complete. This would only save you the iteration of the results to perform the counting.