4 ms·
> Aside from the 9x cost in size, strings don’t sort as fast as numbers because they rely on collation rules. Why would you sort these to begin with; what orde
by michaelcampbell 9y ago
> Aside from the 9x cost in size, strings don’t sort as fast as numbers because they rely on collation rules.
Why would you sort these to begin with; what ordering of essentially randomness (part of the point) makes sense?
- mi100hael 9y agoI believe UUIDv1 is time-based, so you can sort the keys and get the sequential order the UUIDs were generated.
- fooey 9y agofor when everything else is equal, you need something to let you get consistent sorting in your output For example, if your page size is N and you have N+1 things with the same timestamp, you need a backup sort key or your pagination breaks down
- ahachete 9y agoYou should really read this: https://www.slideshare.net/MarkusWinand/p2d2-pagination-done-the-postgresql-way https://www.slideshare.net/MarkusWinand/p2d2-pagination-done...
- whateveracct 9y agoYep the Seek Method for pagination as suggested there would cause you to be sorting by UUID. SELECT uuid FROM t where filterable_field > $whatever and uuid > $lastSeen limit $pageSize with a covering index on (filterable_field, uuid)