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 1nS0Ms-0001Iq-RK for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Mar 2022 17:44:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nS0Mr-0002rR-KK for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Mar 2022 17:44:57 +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 1nS0Mr-0002rH-BD for pgsql-hackers@lists.postgresql.org; Wed, 09 Mar 2022 17:44:57 +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 1nS0Mj-0000I5-R6 for pgsql-hackers@lists.postgresql.org; Wed, 09 Mar 2022 17:44:56 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 2B2395C01F4; Wed, 9 Mar 2022 12:44:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 09 Mar 2022 12:44:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=V5x7qvLl7irgzynv1vfxo2Qg4JgTloNU3LbyA95RocA=; b=PiExqQKu dy2Ve9BT7SMtcV2Noz3/yAsh5mvd/2uhBKS7n++jijfDoLyR2onfIqoElpqXOrUc z02/IIjRT/XQ9TGN/oEDi3n3YnUGMOJsRTwnFonir/VtsZFIZRdnjDOCn0AZyx7H L3EEndW1vX5nzVy9zEkgUvtanR4i2eFTLLq2Pf8QuxAtmrhJttDLRUHPPyishD2Y IT0RngNjEfs5wG7c6u3wt3yV8C+y/oi6mjV4tXIGrij2UMKPlMt1AUiJsheK5pd+ FjPETL/tWPcnq0pcijhKhe4zZqBbz1fnxMd/rFwU/6TwnuvW8dyQKZn/9V0m9njq Fnz6+qWUvZpq2w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddruddukedguddtfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkgggtugfgjgesthekredttddtjeenucfhrhhomheplmhlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepudevgeetieeiheefudevveefgeejieejtdevteekkeel gffgleegteehvdduteegnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhv hhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 9 Mar 2022 12:44:46 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id DEB1C2A0928; Wed, 9 Mar 2022 14:44:42 -0300 (-03) Date: Wed, 9 Mar 2022 14:44:42 -0300 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Zhihong Yu Cc: Andres Freund , "pgsql-hackers@lists.postgresql.org" , Simon Riggs , Tomas Vondra , Daniel Westermann , Amit Langote , Justin Pryzby , Japin Li , Erik Rijkers , Jaime Casanova Subject: Re: support for MERGE Message-ID: <202203091744.o27bb2gpex2j@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-Mar-07, Zhihong Yu wrote: > For v13-0003-MERGE-SQL-Command-following-SQL-2016.patch : > > + * Reset per-tuple memory context to free any expression evaluation > + * storage allocated in the previous cycle. > + */ > + ResetExprContext(econtext); > > Why is the memory cleanup done in the next cycle ? Can the cleanup be done > at the end of the current cycle ? I have removed that, because Andres had already pointed out that it was redundant with the reset done in the caller. > + * XXX Should this explain why MERGE has the same logic as UPDATE? > > I think explanation should be given. Actually, the routine in question is only handling insert, not UPDATE, so MERGE is not relevant to the function. I have removed the comment. This was probably a leftover from work prior to 86dc90056dfd; that commit made it all irrelevant. -- Álvaro Herrera Valdivia, Chile — https://www.EnterpriseDB.com/ "Ninguna manada de bestias tiene una voz tan horrible como la humana" (Orual)