Get the latest tech news
Postgres UUIDv7 and per-back end monotonicity
How Postgres’ v7 UUIDs are made monotonic, and why that’s a great feature.
A nice surprise is that the random portion of the UUIDs will be monotonic within each Postgres backend: It’s possible they’re generated in-order by virtue of being across different milliseconds or by getting lucky, but probability is against you, and the likelihood is that some will be out of order. A millisecond is a short amount of time for a human, but quite long for a computer, and many UUIDs could easily be generated with the space of a single ms.
Or read this on Hacker News