UUID as primary key - Mailing list pgsql-performance

From tsuraan
Subject UUID as primary key
Date
Msg-id 84fb38e30910090956q1dc93945q488f5cf704931303@mail.gmail.com
Whole thread Raw
Responses Re: UUID as primary key  (Mark Mielke <mark@mark.mielke.cc>)
List pgsql-performance
I have a system where it would be very useful for the primary keys for
a few tables to be UUIDs (actually MD5s of files, but UUID seems to be
the best 128-bit type available).  What is the expected performance of
using a UUID as a primary key which will have numerous foreign
references to it, versus using a 64-bit int (32-bit isn't big enough)?

From the uuid.c in adt, it looks like a UUID is just stored as 8
consecutive bytes, and are compared using memcmp, whereas an int uses
primitive CPU instructions for comparison.  Is that a significant
issue with foreign key performance, or is it mostly just the size that
the key would take in all related tables?

pgsql-performance by date:

Previous
From: Alan McKay
Date:
Subject: disk I/O problems and Solutions
Next
From: Tory M Blue
Date:
Subject: Re: concurrent reindex issues