I can not find an efficient solution for sorting search results from the database. My search results returns members of our service, including personal information about each member. Search can produce hundreds of results, and information about each member might contain his/her profile and essays, so I have to be careful about the memory.

The search results have to be sortable by member's age, activity , registration date and so on. I was thinking about a linked list of object (where each object represent a member). To sort this list I have to iterate through the list, extract the sorting parameter , sort them, and rebuild search results list in a new order.

I thought that may be someone had a similar task before, and knows an efficient way how to do that. I would appreciate any ideas. May be not only about sorting, but about cashing this search results as well.