Re: Is there a point to having both a normal gist index and an exclude index?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruno Wolff III <bruno(at)wolff(dot)to>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Is there a point to having both a normal gist index and an exclude index?
Date: 2017-04-05 04:05:31
Message-ID: 17326.1491365131@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bruno Wolff III <bruno(at)wolff(dot)to> writes:
> ... I create both a normal gist index and an exclude index using the
> following:
> CREATE INDEX contains ON iplocation USING gist (network inet_ops);
> ALTER TABLE iplocation
> ADD CONSTRAINT overlap EXCLUDE USING gist (network inet_ops WITH &&);

> But I am wondering if it is useful to have the normal gist index for
> finding netblocks containing a specific IP address, as it seems like the
> exclude index should be usable for that as well.

No, that manually-created index is completely redundant with the
constraint index.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2017-04-05 05:06:48 Re: AEXPR_OR, AEXPR_AND is not in postgres 9.6, how can I rewrite where it used in 9.3 ?
Previous Message lin 2017-04-05 03:28:20 AEXPR_OR, AEXPR_AND is not in postgres 9.6, how can I rewrite where it used in 9.3 ?