pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Teodor Sigaev <teodor@sigaev.ru>
To: Anastasia Lubennikova <a.lubennikova@postgrespro.ru>
To: pgsql-hackers@postgresql.org
Subject: Re: [PROPOSAL] Covering + unique indexes.
Date: Tue, 15 Sep 2015 14:20:18 +0300
Message-ID: <55F7FEF2.7010108@sigaev.ru> (raw)
In-Reply-To: <55F7F0EA.2020303@postgrespro.ru>
References: <55F2C1BC.3010109@postgrespro.ru>
	<55F2CCD0.7040608@postgrespro.ru>
	<CAKJS1f_ApKpHn2B8YHQFx6mKBLadcC0+UFoeCiLetE-W+3A3_A@mail.gmail.com>
	<55F7F0EA.2020303@postgrespro.ru>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Seems, final form is

CREATE INDEX idx ON tbl (f1, f2, f3) [UNIQUE ON (f1, f2)] [INCLUDE (f4)]

f1, f2, f3 are participated in index row comparence (btre, gist etc)
f1, f2 are participated in unique constrain and it gives warranty for
    (f1, f2, f3[, f4]) uniqueness. Now supported by Btree only
f4 doesn't participate in row comparence and could even do not have an operator
    class. Btree and GiST could support that.

The form
CREATE UNIQUE INDEX ON tbl  (f1, f2, f3)
is exact equivalent of form
CREATE INDEX idx ON tbl (f1, f2, f3) UNIQUE ON (f1, f2, f3)

I hope, that it's doible without a lot of difficulties.
-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
                                                    WWW: http://www.sigaev.ru/


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (35+ messages)  latest in thread

Message-ID: <55F7FEF2.7010108@sigaev.ru>
Permalink:  ../55F7FEF2.7010108@sigaev.ru/
Also on:    postgresql.org/message-id/55F7FEF2.7010108@sigaev.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: teodor@sigaev.ru, a.lubennikova@postgrespro.ru
  Subject: Re: [PROPOSAL] Covering + unique indexes.
  In-Reply-To: <55F7FEF2.7010108@sigaev.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox