Re: operator exclusion constraints [was: generalized index constraints]

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: operator exclusion constraints [was: generalized index constraints]
Date: 2009-09-20 17:13:10
Message-ID: 23369.1253466790@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jeff Davis <pgsql(at)j-davis(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-09-20 17:16:08 Re: WIP: generalized index constraints
Previous Message Jeff Davis 2009-09-20 17:08:26 Re: WIP: generalized index constraints