doukuo9116 2014-08-04 12:02 采纳率: 100%
浏览 80
已采纳

基于游标的分页和UUID

I am looking at implementing UUID'd in place of auto-increment id and was wondering if or how I might integrate cursor based pagination with UUID's.

With simple auto-increments I can simply add/subtract on the current ID to find my next/previous but this is not possible with UUID's.

Would it make more sense to use the cursor on a timestamp column suck as created_on / modified_on?

I am working with Laravel 4, PhpLeague\Fractal (https://github.com/thephpleague/fractal) and am looking at bringing in Rhumsaa\Uuid (https://github.com/ramsey/uuid)

  • 写回答

1条回答 默认 最新

  • dongshiru5913 2014-08-04 12:09
    关注

    Ideal would be to have a column with automatic datetime/timestamp and use that as an cursor target. Do keep in mind however to have proper index on that field.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿