I believe this doesn't exist, but please correct me if I am wrong. If it doesn't exist, please add it to the suggestions list ;)
http://davidhayden.com/blog/dave/archiv ... /2652.aspx
SQL Server 2005 has a ROW_NUMBER Function that can help with paging records for you database applications. ROW_NUMBER returns a sequential number, starting at 1, for each row returned in a resultset.
If I want the first page of 10 records from my log file sorted by Date DESC, I can use the ROW_NUMBER FUNCTION as follows:
SELECT Description, Date
FROM (SELECT ROW_NUMBER() OVER (ORDER BY Date DESC)
AS Row, Description, Date FROM LOG)
AS LogWithRowNumbers
WHERE Row >= 1 AND Row <= 10
This is huge. When you SetMaxResults and SetFirstResults with NHibernate it could turn around and transform this into a query of the sort, thus dramatically reducing the data that needs to be fetched. It could then cache portions of the table views that are mostly accessed.
Thx
dB.