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 1nRJap-0004Ei-6K for pgsql-hackers@arkaria.postgresql.org; Mon, 07 Mar 2022 20:04:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nRJao-0000vh-4a for pgsql-hackers@arkaria.postgresql.org; Mon, 07 Mar 2022 20:04:30 +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 1nRJan-0000vQ-Rd for pgsql-hackers@lists.postgresql.org; Mon, 07 Mar 2022 20:04:29 +0000 Received: from new2-smtp.messagingengine.com ([66.111.4.224]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nRJal-0004RY-Q1 for pgsql-hackers@lists.postgresql.org; Mon, 07 Mar 2022 20:04:29 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id AF14D580292; Mon, 7 Mar 2022 15:04:26 -0500 (EST) Received: from imap47 ([10.202.2.97]) by compute5.internal (MEProxy); Mon, 07 Mar 2022 15:04:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :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=pFhiWsDFt2c6tlecY N5h09L4Oc4hYwCKxK2az69uywY=; b=R2uTmey56IZRxo6blWiWICFx88cuwx126 Hf3D6iD53nk+BjxasaD93CePgV/ad+puoS9xO5FRVj8yl2JGBoBJXjmo1jsr1Fg2 G3lp7eT5tCa99MMN7pWbZQnKhOOCOJ1yBnhs+JOHZcKUKFPCxWDxRc8s6x9QZH90 dLzWMtitF2JyBFI/51zIlxhA0CVvIXtcRBnWO8er7/VpuN9xIiMLdtvmra7QXfdJ ke7yHJr/e6fvlf62thMJcC4rGz+6PWVHGMdJb7h+4b83IIsTRMTmFz7EP8rL1o8H dqxxB718J1OZQytDvhF/kRT5Rf4VJ5vMZhEIGDQXK2OOQfaqTil/g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddruddugedgudefvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtsegrtderreerreejnecuhfhrohhmpemllhhv rghrohgpjfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorh hgqeenucggtffrrghtthgvrhhnpeejgeeuleeludfglefgveefuddvvddvkeegieeiteeu heeutdetuedtvdffjeelleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 5D3472740808; Mon, 7 Mar 2022 15:04:26 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-4778-g14fba9972e-fm-20220217.001-g14fba997 Mime-Version: 1.0 Message-Id: <2fcf717a-c542-466a-9031-d2c18206e5c2@www.fastmail.com> In-Reply-To: <7d41dcb8-ca24-40e1-b361-e7ec889e9124@www.fastmail.com> References: <202202271735.4o6uyat2eh7w@alvherre.pgsql> <7d41dcb8-ca24-40e1-b361-e7ec889e9124@www.fastmail.com> Date: Mon, 07 Mar 2022 17:04:01 -0300 From: =?UTF-8?Q?=C3=81lvaro_Herrera?= To: "Andres Freund" Cc: "pgsql-hackers@lists.postgresql.org" , "Simon Riggs" , "Tomas Vondra" , "Zhihong Yu" , "Daniel Westermann" , "Amit Langote" , "Justin Pryzby" , "Japin Li" , "Erik Rijkers" , "Jaime Casanova" Subject: Re: support for MERGE Content-Type: multipart/alternative; boundary=cfbedb626aac4374a2c2b8ef594fd7b1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --cfbedb626aac4374a2c2b8ef594fd7b1 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable On Mon, Mar 7, 2022, at 4:59 PM, =C3=81lvaro Herrera wrote: > I attach v13 here. This version includes a 0002 that's does the split= of nodeModifyTable.c routines, then 0003 implements MERGE on top of tha= t. 0001 is as before. In 0002, I've opted to have two separate structs. One is the ModifyTabl= eContext, as before, but I've removed 'tupleid' and 'oldtuple' (the spec= ification of the tuple to delete/update) because it makes ExecCrossParti= tionUpdate cleaner if we pass them separately. The second struct is Upd= ateContext, which is used inside ExecUpdate as output data from its subr= outines. This is also for the benefit of cross-partition updates. I'm pretty happy with how this turned out; even without considering MERG= E, it seems to me that ExecUpdate benefits from being shorter. --cfbedb626aac4374a2c2b8ef594fd7b1 Content-Type: text/html;charset=utf-8 Content-Transfer-Encoding: quoted-printable
On Mon, Ma= r 7, 2022, at 4:59 PM, =C3=81lvaro Herrera wrote:
I attach v13 here.  This ver= sion includes a 0002 that's does the split of nodeModifyTable.c routines= , then 0003 implements MERGE on top of that.  0001 is as before.

In 0002, I've opted to have two = separate structs.  One is the ModifyTableContext, as before, but I'= ve removed 'tupleid' and 'oldtuple' (the specification of the tuple to d= elete/update) because it makes ExecCrossPartitionUpdate cleaner if we pa= ss them separately.  The second struct is UpdateContext, which is u= sed inside ExecUpdate as output data from its subroutines.  This is= also for the benefit of cross-partition updates.

I'm pretty happy with how this turned out; even without consideri= ng MERGE, it seems to me that ExecUpdate benefits from being shorter. --cfbedb626aac4374a2c2b8ef594fd7b1--