EXLCUDE constraints and Hash indexes

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: EXLCUDE constraints and Hash indexes
Date: 2016-08-17 06:32:00
Message-ID: CAMkU=1z2K1G=MOyKxB8zfn0MHm_Eu-SGBiUmej460VzU=S8EiQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From: https://www.postgresql.org/docs/9.4/static/sql-createtable.html

"The access method must support amgettuple (see Chapter 55); at
present this means GIN cannot be used. Although it's allowed, there is
little point in using B-tree or hash indexes with an exclusion
constraint, because this does nothing that an ordinary unique
constraint doesn't do better. So in practice the access method will
always be GiST or SP-GiST."

This is misleading. Hash indexes do not support unique constraints
directly, but do support them via the EXCLUDE syntax using "WITH =".
This is nice if you want a unique index on something that might
occasionally exceed 1/3 of 8kB (titin, I'm looking at you)

Trivial doc patch attached.

Cheers,

Jeff

Attachment Content-Type Size
exclusion_hash_doc.patch text/x-patch 1.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Borodin 2016-08-17 07:36:53 Re: WIP: Covering + unique indexes.
Previous Message Ashutosh Bapat 2016-08-17 06:27:01 Re: Declarative partitioning - another take