什么是分页大的Resultset -Java的最佳方式 [英] what is best way to paging big Resultset -Java

查看:163
本文介绍了什么是分页大的Resultset -Java的最佳方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从性能的角度来看最好的办法,在网页上部分显示Resultset,每页可以说10个项目,如果用户想看到更多的结果,他按下下一个btn。
i认为(很可能是错误的)当按下Next按钮时它应该是对服务器的新请求??



currentlly我试图学习Java,GWT



谢谢!

PS:对不起我的英文。

解决方案

答案取决于用户的行为:第2页,第10页或页面100 $ $ b

如果他们很少看第2页,也不会看第10页或第100页,那么重新提交请求可能没有问题。



如果他们通常查看第2页,经常查看第10页,偶尔查看第100页,则部分缓存将很有用:缓存前100个(或200个或300个)结果,并且只有在它们超过这些结果时才重新提交查询。我可能会将缓存存储在用户的会话中,但是如果您的应用服务器是集群化的,您必须考虑一下。



如果他们总是翻阅每个结果?部分缓存仍然是答案,因为您不想在内存中存储大量数据。


i am looking for best aproach from perfomance point of view , to show Resultset on webpage partially , lets say by 10 item per page and if user want to see more result, he pressing "next" btn . i think (probablly wrong) it should be new request to the Server when "Next" button is pressed ??

currentlly i trying to learn Java,GWT

thank You!

PS: sorry for my English.

解决方案

The answer would depend on your users' behavior: how often will the look at page 2, or page 10, or page 100.

If they rarely look at page 2, and never look at page 10 or page 100, then resubmitting the request may be fine.

If they usually look at page 2, often look at page 10, and occasionally look at page 100, then a partial cache will be useful: cache the first 100 (or 200, or 300) results, and only resubmit the query when they go past those results. I would probably store the cache in the user's session, although you have to give that some thought if your application server is clustered.

And if they always page through every result? Partial caches are still the answer, because you don't want to store large chunks of data in-memory.

这篇关于什么是分页大的Resultset -Java的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆