Performance issue with resultset [duplicate]
Possible Duplicate:
Resultset in session
i have a query which builds a resultset,which is has some three lakh (300k) records.And the resultset is placed in the session.i tried to improve by iterating resultset and place it in List>.But even after using this,we have performance issues.Is there any other way for this?
It is a very bad idea to load such huge number of rows into memory and especially putting them into session. You need to implement pagination - modify the query to fetch a subset of rows and then when you need the next set execute a query again.
Yes, there's another way--don't put it in session.
Here's the thing: we don't know why you're putting it in the session, because you don't provide any details.
For pagination? Use a limit/offset mechanism and only request the current page's results.
For reporting? Generate the report at the end of whatever data narrowing functionality you're using and only store criteria in the session.
Or...?
精彩评论