Re: UUID column as pimrary key? - Mailing list pgsql-general

From Stuart Bishop
Subject Re: UUID column as pimrary key?
Date
Msg-id AANLkTim_Zqg+NNKNxcq+qMX4vXM0FrX2DMfAGKFL=D_8@mail.gmail.com
Whole thread Raw
In response to Re: UUID column as pimrary key?  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
Responses Re: UUID column as pimrary key?
Re: UUID column as pimrary key?
List pgsql-general
>>> Next to that, UUID's are generated by computers. I have no doubts that
>>> the numeric space that makes up a UUID allows for collision chances as
>>> low as described, but are computers capable of generating those
>>> numbers sufficiently random that they actually achieve that low a
>>> chance? I think that's pushing it.

> The main point with the randomness of UUID's remains that you _can_ have a collision at any given moment. It's
unlikelyto ever happen, but you can't predict when it will happen if it does. The possible consequences of a collision
mattera lot in designing whether and how to handle these collisions. Maybe it doesn't matter at all, maybe you should
geta really hefty insurance, or maybe you need to evacuate the country. 

Given the math, I suspect the chance of a UUID collision generated by
a respected library is roughly the same or less than any other method
of choosing a unique id. If you are looking at these extreme
improbabilities, your SERIAL isn't guaranteed unique either when you
take into account cosmic rays flipping the right bits in your ECC
memory or on your disk platter.

So if you are worried about such things, give up now because your
application is going to have to run with hardware and software in this
universe with all its limitations.

Maybe I should start a business in providing UUID collision insurance?

--
Stuart Bishop <stuart@stuartbishop.net>
http://www.stuartbishop.net/

pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: UUID column as pimrary key?
Next
From: Jasen Betts
Date:
Subject: Re: UUID column as pimrary key?