在 2006-04-13四的 06:33 -0400,Adam Tauno Williams写道: > > I suspect (guess) the sorting is actually done in a very simple way by the > > LDAP client: > > 1) the client (ldap_search or php) connect to the LDAP server and search > > with filter, ask the server to return only the search key attribute. > > 2) 1,000 search keys are returned from server (along with dn); > > 3) the client sort the keys, and determin which are the first 20 items; > > 4) and query LDAP server again ask for the 20 items. > > That is a dumb design; if you've already got the records, and sorted > them, why do the query again? Even web scripting languages like PHP let > you store an array in a session, so you only need to get the data once, > and then display different sections.
I supppose I should first get as less data as possible in order to do the sorting, and ten retrieve a section of entries of full data. In the application I am currently working on, there are about 30,000 entries in the LDAP server (the data was stored in another application which is going to be ported to my web application). Simply retrieving and storing these data in array exceeds memory limits and cannot stand more then 10 querys per minute. In most cases, we need to sort the data, display a small section (20 entries). I am not sure, if simply retrieve all 'cn' of all the contacts in order to sort them, would be too resource-hungry. I am using openldap, is this DSA the one you said supporting sort on server side (e.g. when using ldap_sort in php)? --- You are currently subscribed to [email protected] as: [EMAIL PROTECTED] To unsubscribe send email to [EMAIL PROTECTED] with the word UNSUBSCRIBE as the SUBJECT of the message.
