Get all users #798
Comments
Hi @jberol, I'd recommend moving to LdapRecord, where you can utilize chunking: |
Hi @jberol / @stevebauman , we are experiencing the same issue and found that the general problem is the way LDAP (and Adldap/LdapRecord) handles paging. It's handled using pointers, so they can always just iterate one page at once, after fetching the next pointer. The pagination therefore is more like a chunking and no real "give me page 4" thing where it just fetches one specific page. The solution, as far as we could tell, would be to implement the newly (PHP 7.3) added support for VLV (Virtual List View), which implements proper pagination on an LDAP level. Unfortunately, this seems to be very poorly documented at the moment. The only reference to it we could find is the LDAP_CONTROL_VLVREQUEST constant in the PHP doc and a PHP internal test case that provides a sample implementation. It looks like neither Adldap nor LdapRecord currently support VLV, so if you only want to access a subset of entries, like we need to, you're SOL :( |
Hey @KarimGeiger! I had no idea this existed in LDAP. Let me see what I can do in LdapRecord 👍 |
That would be awesome! If you need help testing it, I'd be happy to help. Unfortunately I don't really know enough about LDAP/PHP-LDAP to be of any help with the implementation. |
I'll let you know! I'm getting a local Active Directory instance up and running so I'll be able to test with that. Are you on Active Directory as well? I've created an issue so you can track the status of the implementation here: DirectoryTree/LdapRecord#413 |
Yes, we're on Active Directory as well, and with a lot of records, so we can do some performance testing if need be. Thanks for linking the issue, I'll definitely keep track of it. |
Description:
Hello,
I can't get the users without the query getting very slow. Is there a way to remove the recursivity to make the query faster? I leave the query code here:
$users = $search->users()->select(['uid', 'mail'])->get();
I have also tried with paginate and the result is the same, because paginate returns all the records.
There are only 2500 users
Thanks.
Steps To Reproduce:
The text was updated successfully, but these errors were encountered: