2 ms·
Imagine if you were generating 16 UUIDs per nanosecond, every nanosecond. According to [1] due to the birthday paradox, the probability of a collision in any g
by michaelt 2y ago
Imagine if you were generating 16 UUIDs per nanosecond, every nanosecond.
According to [1] due to the birthday paradox, the probability of a collision in any given nanosecond would be 3E−17 which of course sounds pretty low
But there are 3.154e+16 nanoseconds in a year - and if you get out your high-precision calculator, it'll tell you there's a 61.41% chance of a collision in a year.
Of course you might very well say "Who needs 16 UUIDs per nanosecond anyway?"
[1] https://www.bdayprob.com/ https://www.bdayprob.com/
- Horffupolde 2y agoSo what if there’s a collision? If the column is UNIQUE at most it’ll ROLLBACK on INSERT. 16 INSERTS per nanosecond is 16 billion TPS. At that scale you’ll have other problems.