Re: Proposal: Add a UNIQUE NOT ENFORCED constraint - Mailing list pgsql-hackers

From Jacob Jackson
Subject Re: Proposal: Add a UNIQUE NOT ENFORCED constraint
Date
Msg-id CAAiQw3zf2Mzvsi5cd1RA6=ojnq5nyoNyYfE_Gkq-g4LkB_wmTA@mail.gmail.com
Whole thread Raw
In response to Re: Proposal: Add a UNIQUE NOT ENFORCED constraint  ("Joel Jacobson" <joel@compiler.org>)
List pgsql-hackers
On Tue, Jan 6, 2026 at 1:44 AM Joel Jacobson <joel@compiler.org> wrote:
> Can you please share some more details on your use-case?
> I'm curious to learn more about this "unique" column.
> Don't you ever need to do lookups/joins on it (e.g. WHERE col = ?)

The unique column (technically 2 columns that combined are unique)
functions as a pretty typical id. Yes, I do run joins on it, but the
performance advantage of an additional index is outweighed by the
ingest performance hit due to the cardinality of the outer relation
(hash joins are typically used) and the relatively small row size.



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Resetting recovery target parameters in pg_createsubscriber
Next
From: Japin Li
Date:
Subject: Re: Remove deprecated role membership options from psql help for CREATE USER/GROUP