Re: UUID as primary key

From: tsuraan <tsuraan(at)gmail(dot)com>
To: pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: UUID as primary key
Date: 2009-10-10 05:14:27
Message-ID: 84fb38e30910092214x1958c65dua0214f6b07a78512@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> The most significant impact is that it takes up twice as much space,
> including the primary key index. This means fewer entries per block,
> which means slower scans and/or more blocks to navigate through. Still,
> compared to the rest of the overhead of an index row or a table row, it
> is low - I think it's more important to understand whether you can get
> away with using a sequential integer, in which case UUID is unnecessary
> overhead - or whether you are going to need UUID anyways. If you need
> UUID anyways - having two primary keys is probably not worth it.

Ok, that's what I was hoping. Out of curiosity, is there a preferred
way to store 256-bit ints in postgres? At that point, is a bytea the
most reasonable choice, or is there a better way to do it?

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Merlin Moncure 2009-10-10 13:26:19 Re: Databases vs Schemas
Previous Message Tom Lane 2009-10-10 03:11:35 Re: Databases vs Schemas