-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Pagination Optimization
PostPosted: Wed Aug 17, 2005 10:31 am 
Newbie

Joined: Tue Jul 26, 2005 11:35 am
Posts: 3
Hi,
From what I can understand the pagination with SetFirstResult and SetMaxResults has a performance issue unless the database supports rownum natively (Oracle for example).
There are pagination strategies that could fix this performance issue and are very simple to implement.

The pagination algorithm I use in SQL server is:

SELECT ... FROM Table WHERE PK IN
(SELECT TOP @PageSize PK FROM Table WHERE PK NOT IN
(SELECT TOP @StartRow PK FROM Table ORDER BY SortColumn)
ORDER BY SortColumn)
ORDER BY SortColumn

See http://www.codeproject.com/aspnet/PagingLarge.asp for more information.

I think a implementation like this would give a boost on NHibernate to be used on web applications and a lot of people would be very happy.

If you need any help developing this pagination algorithm count me on. I am a software developer.

Regards,
Rui


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.