Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aoXzc-0008Ja-4Q for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Apr 2016 15:06:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1aoXzb-0005K9-MB for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Apr 2016 15:06:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aoXyE-0002Bg-4n for pgsql-hackers@postgresql.org; Fri, 08 Apr 2016 15:05:14 +0000 Received: from newmail.postgrespro.ru ([93.174.131.138] helo=mail.postgrespro.ru) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aoXy9-0001DX-SF for pgsql-hackers@postgresql.org; Fri, 08 Apr 2016 15:05:13 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 2278121C7A3C; Fri, 8 Apr 2016 18:05:07 +0300 (MSK) Received: from mail.postgrespro.ru ([127.0.0.1]) by localhost (mail.postgrespro.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wXith7i5kTNZ; Fri, 8 Apr 2016 18:05:04 +0300 (MSK) Received: from [192.168.27.79] (unknown [192.168.27.1]) by mail.postgrespro.ru (Postfix) with ESMTPSA id 32C8721C7A36; Fri, 8 Apr 2016 18:05:04 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1460127904; bh=UZMh+0Oj1Q8iU32yU4RzURFUsbkTztNU/Bu/z5Mvphs=; h=Subject:To:References:Cc:From:Date:In-Reply-To; b=a9BlbMdsaDEqwPZpOzTF7IJvIT7x5/koR5Zr/UDXMvHq1XISJ1A0Y1m31gD6aJnYl JW/oxntHkXt5ibtC9SXFNXJVHd89dDqFh2lRrTujWFsW1d3SViA2BQYGEP3jbHy0+H 47Ow4+Zb7Lck1ab+uZpEEiOykrMUjLt0lRnEuL/g= Subject: Re: WIP: Covering + unique indexes. To: Teodor Sigaev References: <56167F09.3090101@postgrespro.ru> <56BCBAE0.2080102@postgrespro.ru> <56D46114.9090205@postgrespro.ru> <56D5C970.6020002@postgrespro.ru> <56D5CCFC.1020507@postgrespro.ru> <56E6C35A.2050502@postgrespro.ru> <56EBF17E.2020702@pgmasters.net> <56F0271D.5010004@postgrespro.ru> <5703D236.1090907@postgrespro.ru> <57050BFE.7020805@postgrespro.ru> <57079ED3.5000704@sigaev.ru> <5707A7FD.6080105@postgrespro.ru> Cc: Peter Geoghegan , David Steele , Michael Paquier , PostgreSQL mailing lists , David Rowley From: Anastasia Lubennikova Message-ID: <5707C8A0.1030208@postgrespro.ru> Date: Fri, 8 Apr 2016 18:05:04 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <5707A7FD.6080105@postgrespro.ru> Content-Type: multipart/mixed; boundary="------------060205000803030208080008" X-Pg-Spam-Score: -3.0 (---) 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 This is a multi-part message in MIME format. --------------060205000803030208080008 Content-Type: text/plain; charset=koi8-r; format=flowed Content-Transfer-Encoding: 7bit 08.04.2016 15:45, Anastasia Lubennikova: > 08.04.2016 15:06, Teodor Sigaev: >>> On Wed, Apr 6, 2016 at 1:50 PM, Peter Geoghegan wrote: >>>> Personally, I like documenting assertions, and will sometimes write >>>> assertions that the compiler could easily optimize away. Maybe going >>>> *that* far is more a matter of personal style, but I think an >>>> assertion about the new index tuple size being <= the old one is just >>>> a good idea. It's not about a problem in your code at all. >>> >>> You should make index_truncate_tuple()/index_reform_tuple() promise to >>> always do this in its comments/contract with caller as part of this, >>> IMV. >>> >> Some notices: >> - index_truncate_tuple(Relation idxrel, IndexTuple olditup, int >> indnatts, >> int indnkeyatts) >> Why we need indnatts/indnkeyatts? They are presented in idxrel struct >> already >> - follow code where index_truncate_tuple() is called, it should never >> called in >> case where indnatts == indnkeyatts. So, indnkeyatts should be >> strictly less >> than indnatts, pls, change assertion. If they are equal the this >> function >> becomes complicated variant of CopyIndexTuple() > > Good point. These attributes seem to be there since previous versions > of the function. > But now they are definitely unnecessary. Updated patch is attached One more improvement - note about expressions into documentation. -- Anastasia Lubennikova Postgres Professional: http://www.postgrespro.com The Russian Postgres Company --------------060205000803030208080008 Content-Type: text/x-patch; name="including_docs_update.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="including_docs_update.patch" diff --git a/doc/src/sgml/ref/create_index.sgml b/doc/src/sgml/ref/create_index.sgml index b5f67af..61a21a9 100644 --- a/doc/src/sgml/ref/create_index.sgml +++ b/doc/src/sgml/ref/create_index.sgml @@ -161,6 +161,8 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] INCLUDING clause, which can slightly reduce the size of the index, due to storing included attributes only in leaf index pages. Currently, only the B-tree access method supports this feature. + Expressions as included columns are not supported since they cannot be used + in index-only scan. --------------060205000803030208080008 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------060205000803030208080008--