Have you ever wanted to implement Seam's rich:DataList but the search results could be in the tens or hundreds of thousand of records? Well, I did recently run into that exact issue. For the first attempt I tried to use the standard binding method, but knew it could never work in a production environment.
The problem is that in this mode, the DB is queried for all matching results. In my case that could be up to 200 000 records. So those 200 000 records would be returned from the DB (an arduous task), and then kept in memory - consuming all available resources. I have not measured it but my gut tells me a list like that would easily consume 500MB of RAM in Java. Coupled with the fact that sorting on table headers will sort that huge list in memory on the server, and it is clear that this is not even a solution for a single user system. I am to support about a thousand clients on one server. Ouch!
So I googled the topic and came across this website. I copied this guy's code for the PagingDataModel and related classes (hope I was allowed to do that - did not see any copyright notices in the source code!), and it almost worked.
I say almost because the pager and row count indicators did not work at all. I was a bit baffled, but figured it out. I had my rich:datascroller and h:outputText referencing the PagingDataModel's getRowCount getter method within an tag. I am sure this can be fixed but it seems like that area is rendered before the PagingDataModel's state is properly configured.
The easy solution was to just move those two elements outside of the rich:dataTable. It is working perfectly now.