Re: Primary key gist index? - Mailing list pgsql-general

From Steven Lembark
Subject Re: Primary key gist index?
Date
Msg-id 20180314135234.55f60040@wrkhors.com
Whole thread Raw
In response to Re: Primary key gist index?  (Paul Jungwirth <pj@illuminatedcomputing.com>)
List pgsql-general
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


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Primary key gist index?
Next
From: Paul Jungwirth
Date:
Subject: Re: Primary key gist index?