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 1w5JvK-00384M-0o for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2026 08:49:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w5JvI-00D8ab-2f for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2026 08:49:09 +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 1w5JvI-00D8aS-1R for pgsql-hackers@lists.postgresql.org; Wed, 25 Mar 2026 08:49:08 +0000 Received: from mail-qv1-xf36.google.com ([2607:f8b0:4864:20::f36]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w5JvG-000000012Hb-1OBX for pgsql-hackers@lists.postgresql.org; Wed, 25 Mar 2026 08:49:08 +0000 Received: by mail-qv1-xf36.google.com with SMTP id 6a1803df08f44-89c4f7f8650so80369456d6.0 for ; Wed, 25 Mar 2026 01:49:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774428545; cv=none; d=google.com; s=arc-20240605; b=PRkXK/eQWLblJHNyAzMh11ZlJC/VYyQmHkxku7MKH/zkjGP6WLu+FvylA2Z2svfha8 z6utRcWPYAAVoMUqMe/pVFDcuJZioNoahaRQ5zLXqWwDFPXvOPk4liy90TAa0plbQCxw QxALEkklAFBkOxWlbYzNYP8fDLYKFu92BM5mZaEvX2mIbTLb0EcGOxSrtfW+pD3+r1fc TMHia/cPoZvsold1PHnByIE5oSHwsPHyZ6uRm7m4HbbR9TMjJEFnfW+YoLx1ju0zIEmC Mvyp52eG76xJiCazV1adC8U86w/f2DOJDCra7bhOGKTmlPCxgRm/G1ZkR39tRo/dt6cQ PPpQ== 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=gTMKRwKMkQ0piLlmADMjqVqTVWkDd2e5vHfO5WqrbOY=; fh=TWINlT7T9aJ4xYgSehyv7vsPH1oKnvAhCDesn5b3a9o=; b=T1gl+yvW9TWeTTZKPKX53KJmf8D7axEa2zjQ7KBXW6kneUhca023LxhgdJ3ea7Hm0V VwygfKxPoxxwmT3i3JlsnluEy052Spe6a9iyngZzTwDsnZrpbuzPWiy9Y57pdotCIePh C25TzBIV4cUaitYYujEdtJDyi9kx/qHbRBmzxws37kM3brnDXek8hF6IMoBq6mhjCy97 d1dPD7pfUfBV3CiU3k5B7vlCf9Kgf/Zj7ZmErJa7LBsZX5jjgyZVz/r3aODAjSppWUfe bgLaOWkOzOCMcc7Mvcm7aVfXCEvnQPjZMwaUR+UpkRXmSr5bc7EWH01GPyQPAXHGvqU6 ZWtA==; 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=1774428545; x=1775033345; 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=gTMKRwKMkQ0piLlmADMjqVqTVWkDd2e5vHfO5WqrbOY=; b=no015eHpRyGJxq/VYwzjsVPMAWpTEoSCKuhx/OoTosvSckcePjkghJvJU2GVHe4y4r UH729E/n+9vmBv5dwc+485yqGMi0upFhb49PWOPlLBrEZXbvYd2akStKbiNJz0R/6IM/ BhytmKr8cW1KRveo9bUrQJSWgwxIku2uvxd7V82MgpkxpNHV+zWwKbi3jwnf57FUqVjC 7nh2NPzQlEyO4xdPZPXZzJoD2NaJ5T4FRIEtpLARSyPP3bDSHOd7ZjB0FSIqOXhTdmpE 2UEGlqcF7Q8a8bRXkVyMgqGrukQNJ0IqWUNNPYGu6cj3V2umjX946ktmiApckw+b2h7V Wlnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774428545; x=1775033345; 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=gTMKRwKMkQ0piLlmADMjqVqTVWkDd2e5vHfO5WqrbOY=; b=eqETNuRHqCli7MzrnMAsVGGLa77VHM6X98G7YsrnUs2Q4Kpe0w9nRn7Mrq0niMqqQI VzYw0KgGkO0yDjZVOqGu/9MdLRveiDApdsFNnB60PyNXIbZPSzeDbLluwHmtaLu0X0IK m3UFtHUzs7Uff+q/3bE9el/zMbIrMxrAGTmtAPardJ8CUy29qFSK3P9d4SMpdwOcrKnM 5HC1ouoJSTcDXhsaz0YaStjcKKE1o8QV1nN29ZWIEct7JXCTBu22Zzvj8Q8Rlu2q9dKj I02GWKVkBo7k3NSWJyE97VdfjL+lrYHD54ViCUQYnyvEq82jB2vujyE/ApvAzyK1vTGL CGaQ== X-Forwarded-Encrypted: i=1; AJvYcCU9bqpHFopgU558Hs4pOCS/gk9XWrNGQSF/wu6LUxLnr+IfWhpOnL4ht8NCcZzowHKVKreSNljafu6l3u1A@lists.postgresql.org X-Gm-Message-State: AOJu0YxhLWG04+M1Odjl8aehWgsOMlX0RKQq+QitXhKuSVlOZuTH8PtC WevMG3f8Ct32alEd6cWDN+bNa9Ka43BzCNC7TGMRCBBYJd6hbhPNlLVtRDpeUI0Un+e7X0MNdgV nkXRjGm8e64LVxBYqQYwEGdCJk7fx/KI= X-Gm-Gg: ATEYQzzF3b9jtLq6nSspWscUsfCbfQUR9mULKNTkVa4DhTfmaiqPlt2JiUjdrX2iOf6 LcpiibJ/mxymdUL1nglBUu5zxWYFINXxsl/MbXRXpx69QD+dKyWxZrYr3p0/w6u3wG+HH80tcIl L3DFPYz0KQwyDnsNWpZ38iRMIrvyRgXiCvBWcJit9zKx8A+cCey3JplDBvyz6qVeaVEHIQsimH+ QODf01EbAzVJ0D5QkPVG2LstJmHZWwRKdXecuQ4ugKTOZ+eo4708wxowod6vQ08dsO6UAJgKabX Rhp1ZL4= X-Received: by 2002:ac8:5741:0:b0:50b:6b21:2bf7 with SMTP id d75a77b69052e-50b80ac87a1mr41934851cf.0.1774428544785; Wed, 25 Mar 2026 01:49:04 -0700 (PDT) MIME-Version: 1.0 References: <0c28fbd1-3320-4e9b-815c-6d62753aa063@wi3ck.info> In-Reply-To: From: Peter Smith Date: Wed, 25 Mar 2026 19:48:32 +1100 X-Gm-Features: AaiRm51mUizESIQEXweeEZN6sF066guyG1rcDCjCiMQpF9T_j1SDWLGJR8dcbdY Message-ID: Subject: Re: Initial COPY of Logical Replication is too slow To: Masahiko Sawada Cc: Amit Kapila , 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 Swada-San. Here are some minor review comments for v4-0001/2 combined. =3D=3D=3D=3D=3D=3D src/backend/catalog/pg_publication.c is_table_publishable_in_publication: 1. This function logic has a format like if (cond) { ... return; } if (cond2) { ... return; } etc. There are many return points, and most of those "if" blocks cannot fall through (they return). I found it slightly difficult to read the code because I kept having to think, "OK, if we reached here, it means pubviaroot must be false," or "OK, if we reached this far, then puballtables must be false, and pubviaroot must be false," etc. Maybe a few more if/else, or a few Assert() can make it easier to understand how we reached points deeper in this function. ~~~ pg_get_publication_tables: 2. Several code comments appear to wrap prematurely. It looks as if pg_indent was run when the code was different to what it is now. ~~~ pg_get_publication_tables_b: 3. /* Get the information of the specified table in the given publication */ - return pg_get_publication_tables(fcinfo, NULL, PG_GETARG_TEXT_P(0), PG_GETARG_OID(1)); + return pg_get_publication_tables(fcinfo, PG_GETARG_ARRAYTYPE_P(0), relid)= ; Should that comment be plural now, the same as the other one? /publication/publications/ =3D=3D=3D=3D=3D=3D src/include/catalog/pg_proc.dat 4. proargnames =3D> '{pubname,pubid,relid,attrs,qual}', prosrc =3D> 'pg_get_publication_tables_a' }, Shouldn=E2=80=99t the original function proargnames here also be calling th= e first arg 'pubnames' instead of 'pubname' =3D=3D=3D=3D=3D=3D src/test/regress/sql/publication.sql 5. -- Test pg_get_publication_tables(text, oid) function Should that comment now say text[] instead of text? ~~~ 6. Many of those tests have a "good result" test and a "no result" test for each publication. It might be better if they were consistently in the same order (eg, good then none, or none then good). ~~~ 7. Only 3 of the tests are passing multiple publications. Maybe those can be separated from the others (e.g. put last, just to keep all the ones that look alike together). =3D=3D=3D=3D=3D=3D Kind Regards, Peter Smith. Fujitsu Australia