Primary keys and composite unique keys(basic question)

From: Mohan Radhakrishnan <radhakrishnan(dot)mohan(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Primary keys and composite unique keys(basic question)
Date: 2021-03-31 08:36:06
Message-ID: CAOoXFP8gdkAFyDSLbac+advQKPCORYobkGot5CWis+aYZhnb+A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,
We have UUIDs in our tables which are primary keys. But in
some cases
we also identify a composite unique key apart from the primary key.

My assumption is that there should be a unique key index created by us
using the composite key. And when we fetch using this composite key instead
of the primary key we have a performance boost due to the index.

Is this right ? Are there more details I should read to understand this
better ? Please point. If I should use the query planner to look at the
statistics I will.
.
Thanks,
Mohan

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Laurent FAILLIE 2021-03-31 10:27:08 Looking for some help with HA / Log Log-Shipping
Previous Message higher_ground 2021-03-30 22:59:00 Re: BDR question on dboid conflicts