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 1f5HqQ-0004xH-Cm for pgsql-committers@arkaria.postgresql.org; Sun, 08 Apr 2018 21:27:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f5HqP-00029F-8v for pgsql-committers@arkaria.postgresql.org; Sun, 08 Apr 2018 21:27:25 +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.89) (envelope-from ) id 1f5HqP-000296-3t for pgsql-committers@lists.postgresql.org; Sun, 08 Apr 2018 21:27:25 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f5HqL-00070h-Np for pgsql-committers@lists.postgresql.org; Sun, 08 Apr 2018 21:27:24 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w38LRJDY000325; Sun, 8 Apr 2018 17:27:19 -0400 From: Tom Lane To: Alexander Korotkov cc: Teodor Sigaev , pgsql-committers Subject: Re: pgsql: Indexes with INCLUDE columns and their support in B-tree In-reply-to: References: <26445.1523198494@sss.pgh.pa.us> <95278363-d49f-a5e3-106f-d92fac547e19@sigaev.ru> Comments: In-reply-to Alexander Korotkov message dated "Sun, 08 Apr 2018 23:26:04 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <323.1523222839.1@sss.pgh.pa.us> Date: Sun, 08 Apr 2018 17:27:19 -0400 Message-ID: <324.1523222839@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alexander Korotkov writes: > There is also patch for valgrind error in CheckIndexCompatible(). > It appears that this function didn't initialize ii_NumIndexAttrs and > ii_NumIndexKeyAttrs before calling ComputeIndexAttrs(). This > variables weren't used before, but now they're used to determine > whether index column is key. Also, this patch makes ComputeIndexAttrs() > initialize classOidP elements with InvalidOid for non-key attributes. You didn't test this quite enough, because when I tried it I got a batch of warnings about memory chunk inconsistencies. The reason was that DefineIndex only allocated a classObjectId array large enough for the key columns, so that the change in ComputeIndexAttrs made it write past the end of that array. But I think it's a good idea to make those output arrays all the same length, so I kept that change and changed DefineIndex. Pushed; I've not checked to see if this makes valgrind happy, but the buildfarm will tell us. regards, tom lane