Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w4q3D-002bda-06 for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2026 00:55:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w4q2A-003GoL-1T for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2026 00:54:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w4q2A-003GoD-0Z for pgsql-hackers@lists.postgresql.org; Tue, 24 Mar 2026 00:54:14 +0000 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w4q27-00000000n41-2Kbd for pgsql-hackers@lists.postgresql.org; Tue, 24 Mar 2026 00:54:14 +0000 Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-7d55b97f358so493546a34.3 for ; Mon, 23 Mar 2026 17:54:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774313650; cv=none; d=google.com; s=arc-20240605; b=P55BMDE3Jc2ZrmASTvJRkmQU8nq/tyb6jObITiLTF3mzatCwjoJKfEPUWJiLIRFhi7 ROr1kmnzvOT7n5f1W02V5ZmJPafnbt52zcK6xs/Y0Zjhl2h/NqoJQogA68ZyxE0AmSV1 8tPHEDsaG02NHfEMd56G0PdOISxItfO4Jb4pn/KopoFwTbPDzDVcrWFgJAIxV15gziGN 1YWM5U4VfrbRk5Ro+nRrBh9WR3jCpJESbZ1+XdsTENlMZvlYF21U+bzGZ4/gQwcU0IUk BOUsoJ+K2yBPVTnqnGj3wDK/hbzL8Cc0uxX+VhwLbrCsmkr4iZjU5fr+ayZL0DRD+6a4 JzoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=40qcRtkHslPf9EDKxGWdvelYNZtoVwLo06VEpTTailQ=; fh=G55B7JNCNMg7oyDtENImzBNmP9+bcfIA9ssn1y/QYb0=; b=Ts1a5Sb7NXFOc25rt0W6XoCqTDj3iGC1f4VuHacC+k65QRTROKnen+Xa93SkZfSRM9 ZhMzWFzTaTdp35GX8v1WYKKj3oebGD/kQBBnh86tKJaJwEE51pr3rWaIgLUQ3GHTAwfp /3CGo93MmNkXh6UH4jVA7FzyR/Ukveo5EGRbj05rPELB8cPhm42Edm7iL2j824pCMmHA ha3Su9NagCAevlPx9gh9KGHu0MNJRWdhre5MW1Dh/CjoRtNtm/vvcO8aR/3S0sOVG9rX iowHp1Gc8Cn+FMeRHUBiYZm1e1YEql2Xo2NZalRHqeRwmFollGP3VVZuW3rzoKuPUzIz tE9g==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774313650; x=1774918450; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=40qcRtkHslPf9EDKxGWdvelYNZtoVwLo06VEpTTailQ=; b=XSC5ezgFB1sPDq/xL4FaSSm3fv6IJ+aYpE9WyKH4OGku4qYeo08HIbNuywdkugrrKS N+3ioXDKr/CM79A2YpdQYlNO7k6bbyONVSiSaBy1Qcz0fHWE1bUZWjnlYAeq5MH6ThCc Mo7bRZdteGiuA4/FTGLTdLJWRl2ChY8ncaTkFnf905UsK9xhV794ZTOroBreOpyK+b6a 5JA5llnxYyrDRU32pV+g+Ef574Os9cyOsZ6+pjflzc1bdBkCHRTpGY4BD+dD/hc3XaFU Bhfoe9d2SOCyoDQ56J3D+XMp8ahmzy0+OkTK6EsxlPx6vRF8OguZt/dimkJaUIJfyoVz wXkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774313650; x=1774918450; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=40qcRtkHslPf9EDKxGWdvelYNZtoVwLo06VEpTTailQ=; b=hkzhgO2W3q6PXoVlygS6KNsFbMYoZkItZJeeAWb5xk7eUgRHdR+w1h2+FCSzeNv5nd +pOHOchdC6xM8A44fRw+vHXJlr8S4JRhkvMA0LYiJq9Y3lpDwz213So9g+A6sIpJ4iYx yPP0gFjNtcz9sTg3AOZ8toOoajckfcZXcraZnLYcXY0ICOasfzHGThkH+v1a3LZBsfF5 bL1c61J5roICTXbx+Ezfo7Jzy78pFN4PYDGmp/YmIkYAz2AjCd7MhnguMlARnlt/iM3g l1fq74jBcjOTWAa0ouuCHTCCJhW4SH/r73AR1y0DfXyNXaqZ5fAb98eRbEEgHvs9goU8 heAQ== X-Forwarded-Encrypted: i=1; AJvYcCWGHM2i+rws1Ck6GAQJB4LIZQxXKJAYo5G5Enmixs+VZARwyfaIgKeRcXm0n9xRGDSwwpi4EcHcfLEX3Ie+@lists.postgresql.org X-Gm-Message-State: AOJu0Yzi1ZGijG/ssVl3eJp1QIc2v5fG4Jg/tNM21htD5WCA6D528sum YNUr6JBJRHocwdiX+aFXDN+Zo31foTN9ysz+tSLaL17tbvJEtV0499BvEtPMiIVacZOHoepIR0p EYXoMZrWHO/Jy5ndQJUtlTgeNtvDRxkHfLhf7 X-Gm-Gg: ATEYQzxeOqVTZV9gOC1yOW0+WAhZ/+v7uKefUzX781/MeKh3k8kCg/IzDtrWRBvBQTK T6OYd0yfuw/0xtHYfLEMM8UII7/YbSxxmSDLAHtSq7dDqT+OmOTeDBzY47iDYLnjBAx59ds1DU8 Yxc8hHn33IYI9AmSzBLS/QnFM14r5reBN2yD8DweF0FOX7BiW4kZpHTibscPfP3qm+DRiiOfa+i HYpgpEHL99L8vofVh59Cxiu2PZTBAA5ZCM6NLB+bMUb3fzIBpl4vXG7VVOPmdW4/zDaQ/ReE6Ln 7A4iow== X-Received: by 2002:a05:6820:1745:b0:67b:f1f2:322a with SMTP id 006d021491bc7-67c22ee5119mr10109349eaf.28.1774313650313; Mon, 23 Mar 2026 17:54:10 -0700 (PDT) MIME-Version: 1.0 References: <0c28fbd1-3320-4e9b-815c-6d62753aa063@wi3ck.info> In-Reply-To: From: Bharath Rupireddy Date: Mon, 23 Mar 2026 17:53:59 -0700 X-Gm-Features: AaiRm513guCSuzWrLdHsYRf3uBbODWE3fbJtq868yRVN1nRrnQ4Z2i3AveHdiyk Message-ID: Subject: Re: Initial COPY of Logical Replication is too slow To: Masahiko Sawada Cc: Jan Wieck , pgsql-hackers@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Wed, Mar 18, 2026 at 4:29=E2=80=AFPM Masahiko Sawada wrote: > > I've attached the patch to implement this idea. The patch still > introduces a new function but it overloads > pg_get_publication_tables(). We might be able to handle different > input (array or text) in pg_get_publication_tables() better, but it's > enough for discussion at least. Overall, the intent of this patch looks good to me. It avoids the cost of the table sync worker querying all the pg_publication_rel tables to filter them out later in the join. I quickly reviewed the patch and here are some comments: 1/ Typo: s/pg_get_publication_table_info/pg_get_publication_tables 2/ I think it's good to have some quick numbers on how the query latency looks for pre-V19 and the new one that the table sync worker executes on the publisher, say, with 100, 1000, and 10000 tables at least. 3/ + Assert(OidIsValid(target_relid)); Why not error out (by treating it as function input parameter validation) when target_relid is invalid because asserts go unnoticed on production systems? -- Bharath Rupireddy Amazon Web Services: https://aws.amazon.com