Hacker News new | ask | show | jobs
by mamcx 16 days ago
How is this done?
3 comments

They just mean you catch incorrect joins more easily because there is usually no overlap in keys between unrelated tables. Using int, you’re usually going to have some shared values between two unrelated tables.
Statistically impossible to inadvertently generate a collision using UUID keys. UUID is designed to be unique when generated across any computer system. Practically speaking if you have an exactly matching pair of UUIDs from disparate system you have found the exact record match. The name gives a hint "Universally unique identifier". -Not a cryptographer.
You might find this thread interesting. UUIDv4 should probably be avoided

https://news.ycombinator.com/item?id=48060054

It definitely is possible, just very improbable
That’s probably what’s meant by statistically impossible.
"very" is underselling it
It definitely is possible, just very much a "woah, shit, guys come and look at this!" moment.
More like a moment that the guys can’t come because each one was independently struck by a lightning.
The U means if you join the wrong table your join will always come up empty.

It does not actually make it impossible to query the wrong table it just tells you quickly when you’ve done so.