Re: operator exclusion constraints [was: generalized index constraints] - Mailing list pgsql-hackers

From Tom Lane
Subject Re: operator exclusion constraints [was: generalized index constraints]
Date
Msg-id 23369.1253466790@sss.pgh.pa.us
Whole thread Raw
In response to Re: operator exclusion constraints [was: generalized index constraints]  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: operator exclusion constraints [was: generalized index constraints]
List pgsql-hackers
Jeff Davis <pgsql@j-davis.com> writes:
> My use case was something else:

> An index on (a, b, c) enforcing the constraints UNIQUE(a, b) and
> UNIQUE(a, c).

> UNIQUE(a, b) can be enforced efficiently. UNIQUE(a, c) might be less
> efficient depending on the selectivity of "a", but as long as "a" is
> selective I think it's useful. The alternative is updating two indices
> on every insert.

> You may still think this use case is too marginal to bother supporting,
> but I never made an argument for the use case you described above.

You're right, it still seems remarkably marginal.  I'm rethinking
my position on use of CONSTRAINT syntax because of the deferrability
issue, but I'm still unconvinced that we need to allow the constraints
to be decoupled from the indexes.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: WIP: generalized index constraints
Next
From: Tom Lane
Date:
Subject: Re: WIP: generalized index constraints