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 1pEyN9-0005vX-C5 for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Jan 2023 20:03:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pEyN7-0007xO-R9 for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Jan 2023 20:03:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pEyN7-0007xF-GN for pgsql-hackers@lists.postgresql.org; Mon, 09 Jan 2023 20:03:53 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pEyN5-0007V9-1P for pgsql-hackers@lists.postgresql.org; Mon, 09 Jan 2023 20:03:52 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 1310B3200950; Mon, 9 Jan 2023 15:03:49 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 09 Jan 2023 15:03:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; 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; s=fm3; t=1673294628; x=1673381028; bh=KCXdrkhZrN wDirkN5d2bLsdWUIsxJ38xzEYk/Nd4wRU=; b=bxMSCQS03cnCVSQ+CD1x71UyDh CSo12YyECiNe8eb3045vPMLNACFMkY4K1SyNnqCwMhPdCqdCZCMlvTmnkRsiJ5dB qi2E+Wtq1qqT+PdYQjaqH1v4Yg4YpQCe+SAxHozgfgTVWt9wjfOcyD+dHjocv40w AapJb8GuqW+QGFbyDxgbTxOrg+6F2W2eNxhvWmRPcdeLFWlXRuc6GFQA+6KMZWVN wPI6bIdTKqN4UiaLKzytlwB1PcCUz1F77FekRN9YS3E+ICr+IqZxmqo1+VWAtr2n ZTUxU4FtFr4rarb4HQpJRRaGoTqrVa9MrnapXkOsysdXzDZQDIwnXVdld9ew== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id: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= fm3; t=1673294628; x=1673381028; bh=KCXdrkhZrNwDirkN5d2bLsdWUIsx J38xzEYk/Nd4wRU=; b=ANlj/bOv6/vYmZ9rcJ0/keHDmXD2GOqhE+adRPx+Nqap 7Dli/eIXp2FMHvS2lzvpUfa25FsaYREIrvu4U+gX3zr4lN8KfqWRlmTwd+IhRywe 1u6Ls3iGXPPlPPXXv8sK6yvlfj6MmtxXIIWioeXzeL/tnihPMRMzAPpr/Q7Nwtq2 vUhruAcw4+qyhHPm+GPqm+dZK4rzpTx4p1X114Gk20IQLUvHO6hs8EuqINQ7QFSs V4q0r0cTa4Te7rsVKe4dADq+b99tyzYKfl37GbBIIROUypRhplSnDr8NcXmFTm2o Pyhd+7lTXVfACjJANG8VTNd4k5naJjfUkRbUjlPYtA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrkeeigdduvdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrf grthhtvghrnhepvdfffeevhfetveffgeeiteefhfdtvdffjeevhfeuteegleduheetvedu ieettddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 9 Jan 2023 15:03:48 -0500 (EST) Date: Mon, 9 Jan 2023 12:03:47 -0800 From: Andres Freund To: Tom Lane Cc: =?utf-8?B?w5ZuZGVyIEthbGFjxLE=?= , "shiy.fnst@fujitsu.com" , "wangw.fnst@fujitsu.com" , Amit Kapila , PostgreSQL Hackers Subject: Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher Message-ID: <20230109200347.ps43ri7llrxusgu5@awork3.anarazel.de> References: <20221206184756.2fdpd4epvyftutoe@awork3.anarazel.de> <3466340.1673117404@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3466340.1673117404@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2023-01-07 13:50:04 -0500, Tom Lane wrote: > I think we should either live within the constraints set by this > overarching design, or else nuke execReplication.c from orbit and > start using the real planner and executor. Perhaps the foreign > key enforcement mechanisms could be a model --- although if you > don't want to buy into using SPI as well, you probably should look > at Amit L's work at [1]. I don't think using the full executor for every change is feasible from an overhead perspective. But it might make sense to bail out to using the full executor in a bunch of non-fastpath paths. I think this is basically similar to COPY not using the full executor. But that doesn't mean that all of this has to be open coded in execReplication.c. Abstracting pieces so that COPY, logical rep and perhaps even nodeModifyTable.c can share code makes sense. > Also ... maybe I am missing something, but is REPLICA IDENTITY FULL > sanely defined in the first place? It looks to me that > RelationFindReplTupleSeq assumes without proof that there is a unique > full-tuple match, but that is only reasonable to assume if there is at > least one unique index (and maybe not even then, if nulls are involved). If the table definition match between publisher and standby, it doesn't matter which tuple is updated, if all columns are used to match. Since there's nothing distinguishing two rows with all columns being equal, it doesn't matter which we update. Greetings, Andres Freund