5

[数据库/PostgreSQL] 真的没有完美的分页方法吗?

 2 years ago
source link: https://www.v2ex.com/t/840205
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  PostgreSQL

[数据库/PostgreSQL] 真的没有完美的分页方法吗?

  kaifeiji · 6 小时 54 分钟前 · 1351 次点击
因为性能原因,研究了很多分页 SQL 的实现:

1 、limit-offset 的耗时线性增长;
2 、keyset 不能跳转指定页;
3 、xmin 基于事务,可能有“空洞”;
4 、ctid 基于存储,不能用 where 条件过滤;
5 、pg_stats 基于统计数据,实时性差,结果不精确。

具体可参考这篇文章:

https://kaifeiji.cc/post/do-i-really-know-about-pagination/

我想问的是,有没有:

1 、耗时固定
2 、能跳转指定页
3 、没有“空洞”
4 、能用 where 条件过滤
5 、实时性、结果精确

的分页方法?

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK