Re: UUID performance as primary key

Поиск
Список
Период
Сортировка
От Craig James
Тема Re: UUID performance as primary key
Дата
Msg-id 4CB9E0C9.4090702@emolecules.com
обсуждение исходный текст
Ответ на UUID performance as primary key  (Navkirat Singh <navkirats@gmail.com>)
Список pgsql-performance
On 10/15/10 6:58 PM, Navkirat Singh wrote:
> I am interested in finding out the pros/cons of using UUID as a
>  primary key field. My requirement states that UUID would be perfect
>  in my case as I will be having many small databases which will link
> up to a global database using the UUID. Hence, the need for a unique
>  key across all databases.

You left out one piece of information: How many keys per second do you need?

We put a sequence in the global database that all secondary databases use to get their IDs.  It means an extra
connect/disconnect(a pooler can minimize this), so if you're issuing thousands of IDs per second, this isn't a good
idea. But for a small-ish number of IDs per second, it gets you the benefit of a universal ID without the size of the
UUIDfield. 

Craig (the other one)

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

Предыдущее
От: Mladen Gogala
Дата:
Сообщение: Select count(*), the sequel
Следующее
От: Kenneth Marshall
Дата:
Сообщение: Re: Select count(*), the sequel