what is best way to paging big Resultset -Java

前端 未结 6 622
伪装坚强ぢ
伪装坚强ぢ 2021-01-19 06:44

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 p

6条回答
  •  广开言路
    2021-01-19 07:16

    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.

提交回复
热议问题