Andrew Findlay writes:
Retrieving 2M entries in a single operation is going to tax any LDAP server, especially if you do not request paged results. Consider what it must do:
- Make a list of every entry ID
- Retrieve the data for every entry
- Build a message containing 2M entries
- Send the message
No, each entry is sent in a separate message.
However OpenLDAP does build a list of all entry IDs to examine and possibly, subject to indexes for the filters. And it must readlock all these entries so that an update operation won't mess things up while it is sending, and so updates will be atomic as seen by the search request.
I don't know what BDB does when there are 2M entries to examine though. Maybe it just gives up and examines all entries, as LDBM did.