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.

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

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料