Re: UUID column as pimrary key?

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: UUID column as pimrary key?
Дата
Msg-id
1466.1294243312@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
Re: UUID column as pimrary key? Jasen Betts <jasen@xnet.co.nz>
Scott Ribe  writes:
> On Jan 5, 2011, at 8:05 AM, Bill Moran wrote:
>> 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

> Yes, as in: it is *far* more likely that all of your team members and all of your client contacts will be simultaneously struck by lightning and killed in their sleep, and it is *far* more likely that all life on earth will be wiped out by an asteroid impact,

I see those sorts of arguments all the time, and I consider them pure BS.
Yes, the namespace is theoretically large.  However, the questions you
really have to answer are (a) how much of the namespace is actually
being used by the UUID generation methods in use in a particular
application; (b) how sure can you be that there is not correlation
between UUIDs generated in different places/sessions.

In practical use I think the odds of a collision are *far* higher than
you are suggesting, unless the UUID generation is being done with a lot
more care than is likely if the user takes these sorts of claims at face
value.  The odds may still be low enough to be a very good risk, but
you need to think about it not just bet your database on it without
thinking.

Being paranoid is a good thing.  It's what DBAs are paid for.

			regards, tom lane
В списке pgsql-general по дате отправления
От: Bill Moran
Дата:
От: Rob Sargent
Дата:
FAQ