Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1j8Wqh-00071B-Rn for pgsql-committers@arkaria.postgresql.org; Sun, 01 Mar 2020 22:14:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j8Wqg-0007iZ-MR for pgsql-committers@arkaria.postgresql.org; Sun, 01 Mar 2020 22:14:10 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1j8Wqg-0007iR-Ey for pgsql-committers@lists.postgresql.org; Sun, 01 Mar 2020 22:14:10 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j8Wqd-00072c-Uk for pgsql-committers@lists.postgresql.org; Sun, 01 Mar 2020 22:14:10 +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 021ME327005839; Sun, 1 Mar 2020 17:14:03 -0500 From: Tom Lane To: Peter Geoghegan cc: pgsql-committers Subject: Re: pgsql: Add deduplication to nbtree. In-reply-to: References: <27003.1583087095@sss.pgh.pa.us> <29676.1583090977@sss.pgh.pa.us> Comments: In-reply-to Peter Geoghegan message dated "Sun, 01 Mar 2020 13:37:16 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5837.1583100843.1@sss.pgh.pa.us> Date: Sun, 01 Mar 2020 17:14:03 -0500 Message-ID: <5838.1583100843@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Peter Geoghegan writes: > Attached patch shows how this could work. I prefer my original > approach, but I can see the argument for doing it this way. This does seem a bit duplicative ... and shouldn't both code paths include a final "Assert(d == vacposting->ndeletedtids)"? So maybe we're better off just rejecting the Coverity complaint. > If we keep my original approach, we should still add a new > "ItemPointerIsValid(&itup->t_tid)" assertion that covers the plain > tupe case in a way that mirrors the current "_bt_posting_valid(itup)" > assert. Another thing that maybe bears closer scrutiny is the size calculation. It seems a bit confused as to whether the offset of the posting list within the tuple, or the total tuple size, or both, needs to be MAXALIGN'd. regards, tom lane