You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Theo Niemeijer <th...@juras.org> on 2003/03/21 11:08:00 UTC

Webapp google queries: What is a good way to present multiple web pages with query results ?

Maybe someone has a suggestion for me:

The problem I am facing is that a user can have a very long list of results,
and that list of items is presented in multiple pages of HTML (like Google :->)

Let's assume that a query will have 10.000 resultitems, and I display 20 items
per HTML page with a Next and a Previous button. 

- When I use a QueryIterator and for each next page just iterate 20 items further 
I assume that it will tie the database connection up for quite some time, 
and I can not even be sure that the user will ask for the next page of results ! 

- When I just get all the items in a large collection it will cost me a lot of
"materialisation" time and a lot of memory. 

- When I only ask for the object identities and then get the pages by making a query 
for 20 identies in a kind of "select ... where id's in [....]" then the user would
have to wait for that query, but it may be mcuh faster than the original query. 

- When I just re-submit the query for each page, and iterate to the correct 20 items
then the user would have to wait for the query each time, but it may actually be
fast because only 20 items would be "materialised". 

  
Anyone having experience with this problem and wanting to share best practices ? 

Regards,
	Theo Niemeijer