Re: Unique Constraints using Non-Unique Indexes

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Unique Constraints using Non-Unique Indexes
Date: 2008-03-20 17:37:44
Message-ID: 20080320173744.GD12266@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)org> http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2008-03-20 17:38:46 Re: Unique Constraints using Non-Unique Indexes
Previous Message Simon Riggs 2008-03-20 17:17:22 Sort Refinement