There are a number of possible ways to handle this, and you don't give any
suggestions.
There's no problem in showing only the first 10 rows on the first page, the
main question is: how do you show the next 10 on the second page ;-)
Here's how I see it
- Read the whole result set into memory, store that in the session. Easy to
implement. Not such a good idea in terms of performance or memory usage I
guess, unless you have a lot of users asking the same question.
- Store the results in a temporary table. Here you have the problem that a
temp table only exists within the scope of a connection. You cannot use the
same connection in several requests unless you store it in a session.
Especially for many-users high volume sites this isn't a very good idea. It
ruins all the benefit you have from the connection pooling. If for some
reason you do use 1 connection per user session, this certanly is an option.
- As unlikely as it seems at first, my best guess would be just do the query
again, discard the first x rows and show the following ones. The probability
that a user will select next is not that high, so performing the query again
isn't that bad. If doing the query is very resource consuming, it's your
first page's performance that will suffer the most ;-)
Don't care about caching, just provide enough RAM for the RDBMS. It will use
it's own caching.
Does this sounnd reasonable? Any other solutions?
How does it work on the real big search engines like altavista or dejanews?
Geert 'Darling' Van Damme
> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Matt Krevs
> Sent: zondag 19 december 1999 21:58
> To: [EMAIL PROTECTED]
> Subject: Re: Large number of records in JSP !!!
>
>
> Dont load the 1000s of records at once.
>
> Send the data back to the browser in small chunks, maybe 100 rows
> at a time.
>
> For example, if the user submits a query that matches 3000 rows,
> only return
> the first 100. Provide a 'more' button that progressively gets
> the next 100
> rows.
>
> Basically you need to handle this situation like most of the
> internet search
> engines do - eg yahoo, dejanews.
>
> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Vaibhav Bhanot
> Sent: Saturday, December 18, 1999 10:13 PM
> To: [EMAIL PROTECTED]
> Subject: Large number of records in JSP !!!
>
>
> Hi All ,
> I am in a fix here...could anybody help me out...i am using jsp's
> at the client side and ORACLE as the backend...i have got around
> thousands of records in some of my tables...now i cannot show all the
> records to client if he queries the database...how should i handle this
> situation...
>
> vaibhav
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> FAQs on JSP can be found at:
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> FAQs on JSP can be found at:
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
>
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html