I implement on the server
with
hibernate / JPA,
MS SQL Server 2008 core database.
SQL is created as follows:
criteria.setFirstResult(pagingParams.getDisplayStart()) .setMaxResults(pagingParams.getDisplayLength());
(The main work is to create the appropriate filter / sort, but this is not relevant here)
What I am observing is the following SQL:
page (0-20): select top 20 this_.id as id11_9_,... page (20-40): select top 40 this_.id as id11_9_,... page (40-60): select top 60 this_.id as id11_9_,...
... and so on.
Obviously, this (a) will encounter serious problems if the basic set of results becomes too large and (b) is not particularly relevant to swapping at all: - (
Anyone who had the same problem?
Update . NHibernate (an implementation of Hibernate.NET) seems to take advantage of the Row_Number() function of T-SQL. Too bad Hibernate doesn't ...
jan groth
source share