Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lEHcr-0002VE-4x for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Feb 2021 20:16:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lEHco-00082R-QN for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Feb 2021 20:16:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lEHco-00082K-Jf for pgsql-hackers@lists.postgresql.org; Mon, 22 Feb 2021 20:16:10 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lEHci-0005S0-7G for pgsql-hackers@lists.postgresql.org; Mon, 22 Feb 2021 20:16:10 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 049195C01C2; Mon, 22 Feb 2021 15:16:02 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 22 Feb 2021 15:16:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=4D6/Oer1oIFuGUPyZdow/maNMo+P6rcGUEOtUPKzMRQ=; b=NfSCgzau /pkqNnvnbxnraoovNVN4tHPop+picQO25Ahsse902yQmZfnKX8/+e8cr8pJNoFFa tAQZL2cCiWbh3ArMUYV7YprvGRK5rFsuJLa7uxSERlRFiPWdgp3Aqwi5SKhMsRO9 XKuYkrk2QmXLSSzefWZDe5mrAJuKq5GGtIVqFcEOpHSe45sz2JTUNAh4rdS52APX H+ZteGIMDsu+q6Dg0agoxvHCg8yFoPxJX/uVP3XZRY/c8yTTNS2YYfCJrWHEOg+J uC2kzO1rTmZv6Pj/MHsdhx5/s+w3WOs312e04RJfyTNiTVidZS1KwViP6F6waVDM ydph8sQaro6KyQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeefgddufeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfgjfgesthekredttderudenucfhrhhomheplmhlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnheptefgvdevvdelueehtdeiuddutdejgffhffdugedvkeff vdektdekffeuueekveefnecukfhppeduledtrdelhedrudelrddujeejnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegr lhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.177]) by mail.messagingengine.com (Postfix) with ESMTPA id 7AFE6108005F; Mon, 22 Feb 2021 15:16:00 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 04E5E2A0F80; Mon, 22 Feb 2021 17:15:58 -0300 (-03) Date: Mon, 22 Feb 2021 17:15:57 -0300 From: =?iso-8859-1?Q?=C1lvaro?= Herrera To: Michael Paquier Cc: Anastasia Lubennikova , pgsql-hackers@lists.postgresql.org Subject: Re: some pointless HeapTupleHeaderIndicatesMovedPartitions calls Message-ID: <20210222201557.GA32655@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2021-Feb-21, Michael Paquier wrote: > On Sat, Feb 20, 2021 at 12:25:58PM -0300, Álvaro Herrera wrote: > > Hmm. Alternatively, maybe it'd make sense to change > > HeapTupleHeaderSetMovedPartition to use ItemPointerSetMovedPartitions > > instead of doing ItemPointerSet directly. But that looks mostly > > pointless, since the extensibility aspect of this interface has been > > superseded by table AM work. I agree we should just remove the macro > > and update the comment as you suggest. > > Thanks. So you will do this change in the same commit, right? I changed my mind on this after noticing that ItemPointerIndicatesMovedPartitions has a few callers; leaving the interface incomplete/asymmetric would be worse. So I propose to do this. diff --git a/src/include/access/htup_details.h b/src/include/access/htup_details.h index 7c62852e7f..86b3622b5e 100644 --- a/src/include/access/htup_details.h +++ b/src/include/access/htup_details.h @@ -443,11 +443,10 @@ do { \ ) #define HeapTupleHeaderIndicatesMovedPartitions(tup) \ - (ItemPointerGetOffsetNumber(&(tup)->t_ctid) == MovedPartitionsOffsetNumber && \ - ItemPointerGetBlockNumberNoCheck(&(tup)->t_ctid) == MovedPartitionsBlockNumber) + ItemPointerIndicatesMovedPartitions(&(tup)->t_ctid) #define HeapTupleHeaderSetMovedPartitions(tup) \ - ItemPointerSet(&(tup)->t_ctid, MovedPartitionsBlockNumber, MovedPartitionsOffsetNumber) + ItemPointerSetMovedPartitions(&(tup)->t_ctid) #define HeapTupleHeaderGetDatumLength(tup) \ VARSIZE(tup) -- Álvaro Herrera Valdivia, Chile "¿Cómo puedes confiar en algo que pagas y que no ves, y no confiar en algo que te dan y te lo muestran?" (Germán Poo)