Thread: UUID, performance of primary keys
Hi Postgres professionals, I'd like to use UUID for object id's (java.util.UUID). Such an object consists of two long values. I could now use two columns (int8) in a table for the primary key or one using the string representation. But I don't know which option is the more performant one or if there exist another more suitable solution. Does anybody know more about this issue? Andreas
On Thu, Jun 18, 2009 at 3:24 AM, Andreas Junius <andreas@junius.info> wrote:
The ints will be faster, I believe. However, there is a UUID data type in postgresql. I'm not sure what its performance would be, relative to the other two options.
Sean
Hi Postgres professionals,
I'd like to use UUID for object id's (java.util.UUID). Such an object consists of two long values. I could now use two columns (int8) in a table for the primary key or one using the string representation. But I don't know which option is the more performant one or if there exist another more suitable solution. Does anybody know more about this issue?
The ints will be faster, I believe. However, there is a UUID data type in postgresql. I'm not sure what its performance would be, relative to the other two options.
Sean