[Date Prev][Date Next] [Chronological] [Thread] [Top]

server-side sorting

I am not volunteering to do this at the moment (got other pressing issues),
just had some thoughts about it that I wanted to kick out.

This can easily be done in the front end using the operation callbacks. At
the beginning of the search, allocate an array of (sizelimit) Entry pointers.
In the send_search_entry callback, just copy the entry to this array. In the
send_search_result callback, sort the entries and then send out the array
contents. Cleanup can be done in the send_response callback.

It might be nice if the individual backends did not free the entries they
pass to send_search_entry, and left it up to send_search_entry to do this.
Then the callbacks would not have to dup any entries they want to keep
hanging around. But this would leave all those entries readlocked, which is
probably a bad idea. Just trying to balance memory use against everything
else... An entry_dup operation for this purpose can be optimized a little,
using the same approach that entry_encode takes. Dup the entire entry into a
single chunk, free as a single chunk...

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support