Re: Primary key gist index?

From: Steven Lembark <lembark(at)wrkhors(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Cc: lembark(at)wrkhors(dot)com
Subject: Re: Primary key gist index?
Date: 2018-03-14 18:52:34
Message-ID: 20180314135234.55f60040@wrkhors.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 14 Mar 2018 11:28:59 -0700
Paul Jungwirth <pj(at)illuminatedcomputing(dot)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(at)wrkhors(dot)com +1 888 359 3508

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Paul Jungwirth 2018-03-14 19:08:56 Re: Primary key gist index?
Previous Message Adrian Klaver 2018-03-14 18:45:39 Re: Primary key gist index?