From: Steven Lembark <lembark@wrkhors.com>
To: pgsql-general@lists.postgresql.org
Cc: lembark@wrkhors.com
Subject: Re: Primary key gist index?
Date: Wed, 14 Mar 2018 13:52:34 -0500
Message-ID: <20180314135234.55f60040@wrkhors.com> (raw)
In-Reply-To: <420e0752-1197-c1be-c50c-eba42f35ad99@illuminatedcomputing.com>
References: <CAMa1XUiQDM2n5EHPir_ECoTjdA=kEDu1u_p=zMUxzdkkJpgmhw@mail.gmail.com>
<420e0752-1197-c1be-c50c-eba42f35ad99@illuminatedcomputing.com>
On Wed, 14 Mar 2018 11:28:59 -0700
Paul Jungwirth <pj@illuminatedcomputing.com> wrote:
> > EXCLUDE USING gist (id WITH =, as_of_date WITH &&)
> null), but maybe there are other primary-key duties it doesn't meet,
> like defining foreign keys that reference it. I've been on-and-off
The PK does provide a unique index.
It may be worth adding and index on
id where ( upper as_of_date = infinity )
for faster searches of current id's (assuming, of course, that there
is an infinite value for upper of as_of_date).
You will also need a PK if the table is used in foreign key
constraints -- the other table has to ref this table's PK.
--
Steven Lembark 1505 National Ave
Workhorse Computing Rockford, IL 61103
lembark@wrkhors.com +1 888 359 3508
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: lembark@wrkhors.com
Subject: Re: Primary key gist index?
In-Reply-To: <20180314135234.55f60040@wrkhors.com>
References: <CAMa1XUiQDM2n5EHPir_ECoTjdA=kEDu1u_p=zMUxzdkkJpgmhw@mail.gmail.com> <420e0752-1197-c1be-c50c-eba42f35ad99@illuminatedcomputing.com> <20180314135234.55f60040@wrkhors.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox