【发布时间】:2020-08-21 14:51:25
【问题描述】:
AFAIK,Pageable 类仅支持基于 LIMIT/OFFSET 的分页。然而,虽然它是一个非常通用的解决方案,但它也有一些缺点,如下所述https://momjian.us/main/blogs/pgblog/2020.html#August_10_2020
Keyset Pagination(又名 Seek Method 或 Cursor-based Pagination)在并发数据插入期间的性能和行为方面具有一些优势,并且删除。详情见
- https://use-the-index-luke.com/no-offset
- http://allyouneedisbackend.com/blog/2017/09/24/the-sql-i-love-part-1-scanning-large-table/
- https://slack.engineering/evolving-api-pagination-at-slack-1c1f644f8e12
- https://momjian.us/main/blogs/pgblog/2020.html#August_17_2020
那么,有没有计划支持这种分页方法,例如通过Pageable<KeyType> 和getKey() 然后合并到SQL 的WHERE 子句中?
【问题讨论】:
标签: pagination spring-data-jdbc