Re: Unique Constraints using Non-Unique Indexes - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Unique Constraints using Non-Unique Indexes
Date
Msg-id 20080320173744.GD12266@svana.org
Whole thread Raw
In response to Unique Constraints using Non-Unique Indexes  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: Unique Constraints using Non-Unique Indexes
List pgsql-hackers
On Thu, Mar 20, 2008 at 02:35:38PM +0000, Simon Riggs wrote:
> This would then allow us to use a Hash Index or other index as the basis
> for a Unique Constraint and/or considerably reduce size of indexes.

I was under the impression that the reason only b-tree supported unique
indexes was because it could lock one page while to checking visibility
to block concurrent inserts. AIUI other index types (notably gist) would
not be able to easily block concurrent inserts because the place a new
item is entered into the index is not unique nor necessarily deterministic.

Whether hash could support this usage I don't know.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

pgsql-hackers by date:

Previous
From: Decibel!
Date:
Subject: Re: [Fwd: Re: [PATCHES] 64-bit CommandIds]
Next
From: Sam Mason
Date:
Subject: writing a MIN(RECORD) aggregate