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 1w8BIF-000HiJ-3B for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Apr 2026 06:12:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w8BIC-0049Hn-29 for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Apr 2026 06:12:37 +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 1w8BIC-0049Hf-12 for pgsql-hackers@lists.postgresql.org; Thu, 02 Apr 2026 06:12:36 +0000 Received: from mail-qt1-x829.google.com ([2607:f8b0:4864:20::829]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w8BI9-000000009FB-17Ur for pgsql-hackers@lists.postgresql.org; Thu, 02 Apr 2026 06:12:35 +0000 Received: by mail-qt1-x829.google.com with SMTP id d75a77b69052e-50904a8f421so5385921cf.2 for ; Wed, 01 Apr 2026 23:12:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775110351; cv=none; d=google.com; s=arc-20240605; b=SAbOlF4qLyriM7nRzdZy92Q2E/GhaoOgE7e7Btd5jQDvJqy0iLKVJASx9+waXVM3Nc FhsyMjXH21XXNSK+/xvYyGBFSy4xGtjZyU12oyoZvV0G2DvFA3pOktRc3qcvth4G0HCZ UWiiNa5gto4Mr+Sb2zbfVHz3bLWntXUA6OwtpIVVdje4ZQ8gL4bpQM8wmb+76GMBj6ky gKHDuEoF+EBvwi5UByAuaNHULQesCV71GiUpk7t8tgQ0ssy+xbo67PYHIJFiC/Ux2F/w TkZQHROozmeRdAtRJDB3+yA3OkVO4Gbwkigl20EwRvE1MFLTsslfCbFvrSB8CktWT8dG 4V/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=lBMQRDmzxk7N9tAfNR7D3R55q8gg4bVKxOCP9z3N0oY=; fh=l+V2ZTZ+TAgCCNTGbmb8JeSsKIsn35nyAMmforG7sFw=; b=e09IXi/4XNOilI+WqeXS1RX3WrsePqI8bO0xkEJ8l0xCZ/JtdrMmD1pSk6TL0Qn8g2 cfgQV9k5hDYG00/IITtGUkg3Xnhokj6WEydMbWhzIsSUuxoccYcEnAUDRH82JyBmwvxr yjLWuX/6gCM6ZpEt73ofPxmV5gdbI9hSmcokjZxZWovJV6DWbYyGyfzGuSS6kQ2tcVMM 3pIYRho98i87ExEoOsYMfO1ln9zgN+DXdgjhCC9TAPESWigvL/h9PENWJDFNCyJkJfhC XMZ5dt/oY/xqhew4HjLZAqSD6msfyS1Rn87v9mKH5Wkiqd1DmLo7vD1d+ykdianjv44F 2J3Q==; 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=1775110351; x=1775715151; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=lBMQRDmzxk7N9tAfNR7D3R55q8gg4bVKxOCP9z3N0oY=; b=QcwuIbgsLxduqDw3NFBTPFFKeu9u/9IiEiWpt5KPUpeb9iQc12X31jQXmVPF7ziNK7 RpJqyIHj/PoplTzgXV2aehRHEf9bp1yldeobXKfOlHgq8nRKO9WTVWu6i/nPRe1s5WAc +NOrA4QsdgmNhyJDvLFzF81EHq/dhn/2VIcgrU+z3ETJltSrQxQrW5s9rwlSwkMfGcQD 5DNleSMSLwKgMsvMr5XEL++/qtAvTQGAXOiksAAc0GrOPmGucFcmRWOpjvvkg/E8yCvC 2DoPV+5kTumdGPQ2CWKflNBKQVe8l7osWPR5qN/eE6d7B2f7pcyaDoIwb7URWAtPZipD phmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775110351; x=1775715151; h=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=lBMQRDmzxk7N9tAfNR7D3R55q8gg4bVKxOCP9z3N0oY=; b=ljaMlAJs8ZIl/fxo6+Hc3zZAM7MGoSXjEFzAo8hpOEVxB96rz4hWCIpi05arvXNt4i df/EbcHdDtmpBqi6unq4bxgZguxUOxjhINBvN35nBvE8YkhOE/iUQwfCJvQwJcYMnBUB 5/JD+oecj8Uy2bqkrExUrSXqtDZXXXsuQC+QLwEOZTnOeTWIoThFz18yHmIObBjrfBtd ckF/qFc3H8/OKJvX2pBFgk1kxAU+mKGdME66zL0Z+btfVTYMR8NL6CYVPyX9MLaRUWZc bDCJerpzo/mBH28x0F+LWj1mS8U7eWhbKoSDyr3GWLvfPDTKsgAxPkNslrO5y+D2mVXX 3uOg== X-Forwarded-Encrypted: i=1; AJvYcCXV8L232Aoapjqzl/2hD6YmdldxdwIcCtZppENJIQNpcXFJgBKFQZazzvFR0RscqSe3Jd8G2mVaXKBgCCq1@lists.postgresql.org X-Gm-Message-State: AOJu0Yz6bItWf8SQdK4r938AwoW+1IByfbfsLY3vBB+cWk/9mWo/reDc 4ntg+wyqxQsuITKp4AhcpdYT3h96h7po8RBknX7/QDL53ijDuOEEEaI+39qJ7joDwjL0HjCwWRO R83UohJRMh4GYh6gUsGkl4wb/BehVeuE= X-Gm-Gg: ATEYQzysjUDTi6EjNKrm3s8BexBjdDoF4dJD+6AEc3DLxXgrUq6ylEH5KTSsLFC5G9t CCtIDaY2OA8MF1Tnnu4vBC8lWB4jaO6XZwOtcaeevZS1Fm2j8sx5/sGKCRhVBOflD+M3oElmbH5 6VEalPW+c/AUhV4jCmqo3ko1TPnoG4qLV2uodf76dy+XKdtcK+hix9a2a7bLJyLVbpC5K03TxyC iwwW93dUHUACdHM56sOchrkxEs9IQzidIitDz0zzYiqhruxuzP1n9JWZzpTHf/JiiZmeuezsHao CVWxoe/68kw8vrmODeEecid/fjvtPkLLyvxVuMVkJalNyS4ApaOJ X-Received: by 2002:a05:622a:348:b0:509:8fb:3342 with SMTP id d75a77b69052e-50d3bd0661dmr92697301cf.56.1775110350792; Wed, 01 Apr 2026 23:12:30 -0700 (PDT) MIME-Version: 1.0 References: <0c28fbd1-3320-4e9b-815c-6d62753aa063@wi3ck.info> In-Reply-To: From: Peter Smith Date: Thu, 2 Apr 2026 17:12:03 +1100 X-Gm-Features: AQROBzCZ6_8kWNQe7ny-OBe7x2mtsiJBrv2P7RxTeiu4pv4maS8Fn4omdnAWk5Q Message-ID: Subject: Re: Initial COPY of Logical Replication is too slow To: Masahiko Sawada Cc: "Zhijie Hou (Fujitsu)" , Amit Kapila , Jan Wieck , "pgsql-hackers@lists.postgresql.org" Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Sawada-San Some review comments for v8-0001. ====== Commit message 1. The existing a VARIADIC array form of pg_get_publication_tables() is preserved for backward compatibility. Tablesync workers use the new two-argument form when connected to a publisher running PostgreSQL 19 or later. ~ Typo? "The existing a VARIADIC" ====== src/backend/catalog/pg_publication.c is_publishable_table: 2. + /* + * Sequences are publishable according to is_publishable_class() so + * explicitly exclude here. + */ + if (relform->relkind != RELKIND_SEQUENCE && + is_publishable_class(tableoid, relform)) + { + ReleaseSysCache(tuple); + return true; + } It seemed strange to say that "sequences are publishable according to is_publishable_class() so explicitly exclude", but then you proceed to call is_publishable_class() anyway. Maybe using a variable, and a different comment could be a better way of expressing this? SUGGESTION bool ret; ... /* Sequences are not tables, so this function returns false. */ if (relform->relkind == RELKIND_SEQUENCE) ret = false; else ret = is_publishable_class(tableoid, relform); ReleaseSysCache(tuple); return ret; ~~~ is_table_publishable_in_publication: 3. + * A helper function for pg_get_publication_tables() to check whether the + * table of the given relid is published for the specified publication. /table of the given relid/table with the given relid/ /is published for the/is published in the/ ~~~ pg_get_publication_tables: 4. + * If filter_by_relid is true, only the row for target_relid is returned; + * if target_relid does not exist or is not part of the publications, zero + * rows are returned. If filter_by_relid is false, rows for all tables + * within the specified publications are returned and target_relid is + * ignored. Should that say "only the row(s) for target_relid", e.g. possibly plural, because if same table is in multiple publications then there are be multiple result rows, right? ====== src/include/catalog/pg_proc.dat 5. Missed my previous [1] review comment #4? First arg of pg_get_publication_tables_a should be plural 'pubnames', same as first arg of pg_get_publication_tables_b. ====== src/test/regress/sql/publication.sql 6. +CREATE PUBLICATION pub_all_except_no_viaroot FOR ALL TABLES EXCEPT (TABLE tbl_parent, gpt_test_sch.tbl_sch) WITH (publish_via_partition_root = true); Why is this publication called '...no_viaroot' when publish_via_partition_root = true? ~~~ 7. +-- test for the EXCLUDE clause Typo? /EXCLUDE clause/EXCEPT clause/ ====== [1] https://www.postgresql.org/message-id/CAHut%2BPuSkabUB8H_hcwQz%3DBX5TWEj-8Ba%2BCP_PX78zN1fkhtKA%40mail.gmail.com Kind Regards, Peter Smith. Fujitsu Australia