Re: UUID column as pimrary key?

Поиск
Список
Период
Сортировка
От Bill Moran
Тема Re: UUID column as pimrary key?
Дата
Msg-id 20110105100529.6407650b.wmoran@potentialtech.com
обсуждение исходный текст
Ответ на Re: UUID column as pimrary key?  (Scott Ribe <scott_ribe@elevated-dev.com>)
Ответы Re: UUID column as pimrary key?
Re: UUID column as pimrary key?
Список pgsql-general
In response to Scott Ribe <scott_ribe@elevated-dev.com>:

> On Jan 5, 2011, at 1:31 AM, Radosław Smogura wrote:
>
> > * simple to generate, and 128bit random is almost globally unique,
>
> Almost? Should be totally unique, as long as your random source is decent quality.

This is going off-topic, but I did some research on this because we
were considering using UUIDs for various keys ...

Fact is, UUIDs are not _guaranteed_ to be unique.  If you use the generating
system that includes a MAC address, then in theory, they are guaranteed
to be unique, but in practice, MAC addresses aren't guaranteed to be
unique either, so that's not 100% either.

Beyond that, the namespace size for a UUID is so incomprehensibly huge
that the chance of two randomly generated UUIDs having the same value
is incomprehensibly unlikely ... it is, however, not a 100% guarantee.

Anyway, in our case, we determined that the chance of UUID collision
for the dataset in question was extremely unlikely, however, the
consequences of such a collision were pretty bad.  We also determined
that we were able to control a "unit ID" for each independent system
that would generate IDs, which could (a) be part of a unique seed for
UUIDs, or (b) be a prefix to a autonumber ID that would be a lot easier
to read and work with manually.  In the end, we chose b for the human
factor.

Face it, reading, remembering, and typing UUIDs kinda sucks.

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

В списке pgsql-general по дате отправления:

Предыдущее
От: Scott Ribe
Дата:
Сообщение: Re: UUID column as pimrary key?
Следующее
От: Scott Ribe
Дата:
Сообщение: Re: UUID column as pimrary key?