Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f0s4U-0007Oy-VW for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Mar 2018 17:07:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f0s4T-00043z-UT for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Mar 2018 17:07:41 +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.89) (envelope-from ) id 1f0s4T-00043p-Jq for pgsql-hackers@lists.postgresql.org; Tue, 27 Mar 2018 17:07:41 +0000 Received: from hook.sigaev.ru ([93.180.27.50]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f0s4Q-00030R-3y for pgsql-hackers@lists.postgresql.org; Tue, 27 Mar 2018 17:07:40 +0000 Received: from xor.sai.msu.ru (unknown [93.174.131.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: teodor) by hook.sigaev.ru (Postfix) with ESMTPSA id 59892B191A0; Tue, 27 Mar 2018 20:07:35 +0300 (MSK) Subject: Re: WIP: Covering + unique indexes. To: Peter Geoghegan , Alexander Korotkov Cc: Anastasia Lubennikova , Thomas Munro , Andrey Borodin , PostgreSQL Hackers , Anastasia Lubennikova References: <56168952.4010101@postgrespro.ru> <7FEB0867-F4F2-4F18-8AA9-7BAA0BB32868@yandex-team.ru> <151654594496.23710.401435331419974842.pgcf@coridan.postgresql.org> <1d2b6e12-9e1c-8df5-fdd6-4d20d3791b86@postgrespro.ru> <78ca1586-647c-e159-ebf3-30957e270c66@postgrespro.ru> From: Teodor Sigaev Message-ID: <7789d9f5-3fca-1531-e771-932cbcbe91e3@sigaev.ru> Date: Tue, 27 Mar 2018 20:07:34 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > The last time I looked at this patch, in April 2017, I made the point > that we should add something like an "nattributes" argument to > index_truncate_tuple() [1], rather than always using > IndexRelationGetNumberOfKeyAttributes() within index_truncate_tuple(). Agree, it looks logical because a) reading code will be simpler b) function will be use for any future usage. > Having this index_truncate_tuple() "nattributes" argument, and storing > the number of attributes directly improves quite a lot of things: Storing number of attributes in now unused t_tid seems to me not so good idea. a) it could (and suppose, should) separate patch, at least it's not directly connected to covering patch, it could be added even before covering patch. b) I don't like an idea to limiting usage of that field if we can do not that. Future usage could use it, for example, for different compression technics or something else. > > * It makes diagnosing issues in the field quite a bit easier. Tools > like pg_filedump can do the right thing (Tom mentioned pg_filedump and > amcheck specifically). The nbtree IndexTuple format should not need to > be interpreted in a context-sensitive way, if we can avoid it. Both pg_filedump and amcheck could correclty parse any tuple based on BTP_LEAF flags and length of tuple. -- Teodor Sigaev E-mail: teodor@sigaev.ru WWW: http://www.sigaev.ru/