开发者

Performance issue with resultset [duplicate]

This question already has answers here: 开发者_JAVA技巧 Closed 11 years ago.

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...?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜