Discussion about this post

User's avatar
Krzysztof Szularz's avatar

> But the worst problem of using UUID version 4 in the particular case of DB primary keys is that it is random, and therefore, can't be sorted or indexed. This makes looking up one particular ID slower than alternatives.

Well, I do not agree with this. UUID4 can be sorted and indexed.

The problem is that the part of the index where it resides is less likely to be cached.

UUID7 improves on that since most operations are done on recently created objects, so the UUID7 indexes are more likely to be already in RAM, etc.

Expand full comment
Camille Farineau's avatar

And you can see all V4 ones (and even search) there: https://everyuuid.com/

Expand full comment
2 more comments...

No posts