Re: UUID performance as primary key - Mailing list pgsql-performance

From Craig James
Subject Re: UUID performance as primary key
Date
Msg-id 4CB9E0C9.4090702@emolecules.com
Whole thread Raw
In response to UUID performance as primary key  (Navkirat Singh <navkirats@gmail.com>)
List 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 by date:

Previous
From: Mladen Gogala
Date:
Subject: Select count(*), the sequel
Next
From: Kenneth Marshall
Date:
Subject: Re: Select count(*), the sequel