Re: Primary keys and composite unique keys(basic question)

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>, Mohan Radhakrishnan <radhakrishnan(dot)mohan(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Primary keys and composite unique keys(basic question)
Date: 2021-04-02 08:40:00
Message-ID: 69a5b7b83689ab456dd4b3cd7eb08e9573652039.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 2021-04-01 at 21:28 -0500, Merlin Moncure wrote:
> I would never use UUIDS for keys though.

That makes me curious for your reasons.

I see the following disadvantages:

- A UUID requires twice as much storage space as a bigint.

- B-tree indexes are space optimized for inserting at the
rightmost leaf page, but UUIDs are random.

- UUIDs are more expensive to generate.

On the other hand, many processes trying to insert into
the same index page might lead to contention.

Is there anything I have missed?

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joao Miguel Ferreira 2021-04-02 09:34:42 pass non-formated query to PL function
Previous Message Jehan-Guillaume de Rorthais 2021-04-02 08:29:00 Re: questions about wraparound