Re: Materialized views and unique indexes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Materialized views and unique indexes
Date
Msg-id 7982.1362713536@sss.pgh.pa.us
Whole thread Raw
In response to Re: Materialized views and unique indexes  (Craig Ringer <craig@2ndquadrant.com>)
Responses Re: Materialized views and unique indexes  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
Craig Ringer <craig@2ndquadrant.com> writes:
> On 03/08/2013 10:55 AM, Michael Paquier wrote:
>> Also, as it is not mandatory for a unique index to be a constraint, I
>> think that we should block the creation of unique indexes too to avoid
>> any problems. Any suggestions?

> How much does the planner benefit from the implied constraint of a
> unique index? I almost wonder if it should be allowed at the cost of
> making the refresh of a matview that fails to comply an error.

A unique constraint can allow join elimination, so I'm thinking that
disallowing them is a bad idea (not to mention that it'd be a
considerable wart in the code to block them for matviews only).
        regards, tom lane



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Enabling Checksums
Next
From: Michael Paquier
Date:
Subject: Re: Materialized views and unique indexes