News for hackers. Stuff that matters.
Re:Avoid UUIDv4 Primary Keys by GuB-42 on Monday December 15, 2025 @01:49PM (#46278622)
I don't think the timestamped UUIDs are "carrying data", it is just a heuristic to improve lookup performance. If the timestamp is wrong, it will just run as slow as the non-timestamped UUID.

If you take the gender example, for 99% of people, it is male/female and it won't change, and you can use that for load balancing. But if later, you found out that the gender is not the one you expect for that bucket, no big deal, it will cause a branch misprediction, but instead of happening 50% of the times when you use a random value, it will only happen 1% of the times, significant speedup with no loss in functionality.

Re:Avoid UUIDv4 Primary Keys by delecti on Monday December 15, 2025 @04:00PM (#46280576)
As soon as you encode imperfect data in an immutable key, you always have to check when you retrieve it. If that piece of data isn't absolutely 100% guaranteed to be perfect, then you have to query both halves of the load balanced DB anyway.
Re:Avoid UUIDv4 Primary Keys by moralestapia on Monday December 15, 2025 @02:07PM (#46278858)
>and you can use that for load balancing

As long as you're not in China or India around specific years ...

GP's point stands strong.