Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZbmI5-000673-6z for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Sep 2015 09:12:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZbmI4-00037b-O0 for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Sep 2015 09:12:40 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZbmGm-0001eu-75 for pgsql-hackers@postgresql.org; Tue, 15 Sep 2015 09:11:20 +0000 Received: from fr1.2ndquadrant.fr ([94.23.17.124]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZbmGj-0007A8-J3 for pgsql-hackers@postgresql.org; Tue, 15 Sep 2015 09:11:19 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by fr1.2ndquadrant.fr (Postfix) with ESMTP id 180DB6E4E2; Tue, 15 Sep 2015 11:11:15 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at fr1.2ndquadrant.fr Received: from fr1.2ndquadrant.fr ([127.0.0.1]) by localhost (fr1.2ndquadrant.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2Zepq8LYD7Kn; Tue, 15 Sep 2015 11:11:13 +0200 (CEST) Received: from [192.168.0.3] (ath91-3-88-167-161-184.fbx.proxad.net [88.167.161.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: charles) by fr1.2ndquadrant.fr (Postfix) with ESMTPSA id 8D61A61F33; Tue, 15 Sep 2015 11:11:11 +0200 (CEST) Subject: Re: [PROPOSAL] Covering + unique indexes. To: David Rowley , Teodor Sigaev References: <55F2C1BC.3010109@postgrespro.ru> <55F2CCD0.7040608@postgrespro.ru> <55F6F7AD.4080307@BlueTreble.com> <55F70D0A.2030503@sigaev.ru> <55F73FDA.2030001@BlueTreble.com> <55F7B7C9.6090109@sigaev.ru> Cc: Jim Nasby , Thomas Munro , Anastasia Lubennikova , pgsql-hackers From: Vik Fearing Message-ID: <55F7E0AB.3020600@2ndquadrant.fr> Date: Tue, 15 Sep 2015 11:11:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 09/15/2015 10:57 AM, David Rowley wrote: >> I agree, that form >> > CREATE UNIQUE INDEX i ON t (f1, f2, f3) INCLUDE (f4) >> > is clear. f4 will be used in row compare and actually planner will be able >> > to use it as unique index (f1, f2, f3) with additional f4 or as >> > as unique index (f1, f2, f3, f4), because uniqueness on (f1, f2, f3) gives >> > warranty of uniqueness on (f1, f2, f3, f4) >> > >> > > I'd vote for this too. However, INCLUDE does not seem to be a reserved word > at the moment. What about CREATE UNIQUE INDEX i ON t (f1, f2, f3) WITH (f4); ? -- Vik Fearing +33 6 46 75 15 36 http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers