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 1w8QIc-000W7b-1w for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Apr 2026 22:14:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w8QIb-008N1Z-0l for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Apr 2026 22:14:01 +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 1w8QIa-008N1Q-2m for pgsql-hackers@lists.postgresql.org; Thu, 02 Apr 2026 22:14:01 +0000 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w8QIY-00000000Gwu-1YFC for pgsql-hackers@lists.postgresql.org; Thu, 02 Apr 2026 22:14:00 +0000 Received: by mail-pg1-x533.google.com with SMTP id 41be03b00d2f7-c757a9251faso452892a12.1 for ; Thu, 02 Apr 2026 15:13:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775168036; cv=none; d=google.com; s=arc-20240605; b=GvuqQTU3lnPEgHOygvDO/eNKDOmz9Gyt5OR2vJDDBfkzvtsdjHohiApF8izfMuz7Je 16rC7sPt3jPb//EGleLeapM4YNpj5fvIBJ5u5pGP9/qO4lARonNBBLDrg7v17DhUwQSH N4bLmCHkf12RFHe5XCxBF1Z1CKZCdFiUX05vuTCTaTUUgR+1+QADRwWjQqWTV32y6+0c OaTZKhBmzLCwRaHoaXViqLaQIKlDYhrLEfb4h3bIzy0Iy3aduuGYBeiswX02Mqk4EV3j n9u23Zx2P599MUuGKjcbu1n1PYimDVREoztPIofpxjXbBnTz2I8qD5xUT6gYefrSpqL+ WNhw== 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=5NajX8O0i9OKb/OQbCXWtk5h/EJIHm+niNLxnkcmV0g=; fh=d2ZryQm3GPLQnyQdZLuPQgPcgc92/sJlnc6Eyx8/szM=; b=ViG0/i1YssYZoQiVFroaPFcsmEHcW4NwmFyDJwS33vxqs/60//7nDh61NyBvV+uW1e EQV7xlSQM7aiko2R/HXWf9EFTpVYnz3jJZvnV0yu/0Qa29DHSbHoCQIlE2sKYzTDEp3d 0wjtMsnQZeUJcCCi8xcKRlxoys2a1Mfe0XqOafblW+c0GuJ7O37A7ICiXHyX2+LVxWeB 889PkG97Bs3uGSZZ7it0RQbMYi/spkF9BdJ+9y9RveAw9fvRC0hNi0Fbv4iN5500mdU8 1NuLBHnWf8giuz9wi4g3LZFaIs94k63XPGc/s5dfjM7+/x8bJ9zDapozuQO4dKuEPbaP T8JA==; 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=1775168036; x=1775772836; 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=5NajX8O0i9OKb/OQbCXWtk5h/EJIHm+niNLxnkcmV0g=; b=Vrft7B2TV0py3S78ha+zXqNdjtzYhsePJPddQnjUXvAhxMPw2Gfvz/M4LVyfelYSZj qBwyAMFO2XLM7Wj2Y+x+usZ905fTC3KdUyquzHQ7Y1G7YFE7LJzvc5lTNpyF++8OvJGp qb9NbUYuTyA8f2LqgcrpQUglS9Xkkhg1vkuG7Uahl7ZV9x59g+9mpEgq3DKv+i7YnZMW 1i67RDkIM3j6aA9vIwWNtlUUmQTFt0Vall9zkL5MFXHEceIqHRTozYbxNZ8MIzU7SbYC a0zPjBmXVnVEEzOzLJX9/JbOdL8ADwOI63N7bVYIvbDF6QGeQr0r4mptf/MBX+iHYbyW 2LNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775168036; x=1775772836; 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=5NajX8O0i9OKb/OQbCXWtk5h/EJIHm+niNLxnkcmV0g=; b=HfiiDwNXic3Kr8VUMvI+kzd6kZ1yB7LdmkFeDPAk1ka+K2Spw9gIy248wTE8snGUmk Oi06QaU7rq6yccOOZygKAd9VRBdmfXdNsyy+Y/xkHmSVWha4N+3d3i9HG4w8HUQcuNOD FU9R0d9Eddsnn3Z1lcsFepRwZQfN5wnYlfBZToPoKR98yrH4CvdLgWcFNHxh2GuT0ABe /1JE3Ysp68GHJ+P2ur/cGcyvUl+qcZ3W7hOy8pNu4S73cmFraPrxTldloz5/tLnOvDzd FOJULH9pxy4GnYGHMxrgny+/+kTYkuT7+/Haku+Juy8dGNUFWOI3FX8pu2HRSx4HY7ss U5Ig== X-Forwarded-Encrypted: i=1; AJvYcCWtKvPj4mUMZYT6Y6gOJvXMK95T3k9MsfUBI5y40TTMCN9aqbKCZETyBEEPwdQowhqdr6+0Z1TrvPNWFkcQ@lists.postgresql.org X-Gm-Message-State: AOJu0Yyg00G7REBI4EDPZGOWsLeeQ88Ohb77V2OCtw9az2/FZAeqIZXy /XmpR71VqzxZfNx9K8NvMKutXWARRv3hPNdru7mKAkdHQ3ioySEr+QbhBOfSzPVYmBYU0XSeq/N 4yU9OaVuFMVd7qK+kizsOS69Psb+BE/8= X-Gm-Gg: AeBDietieURrWcRoAybbu4LYozw7bFb/kzpi+wu2ghTAkEAlxmAeO76BVWdf596eMTp fexfA/DvHrEdn414YCHttnzwjj7cX2SmhNze9Mej8kGyNshcELIu4r1aO/7FNEeqTIJCDtpkKYj pOidOd72tb+2r4P7A4mSvSUequFNiGfciuYHa/t7F1Enehn0wqXMDMQE3mt1VdrHCPAVSz+d0Ht yTWD3PIHtorX3vTb+25roF3BP1i02mVNBYQ61xRSlVde/96glMywgFwixSx+Uu5xKMRW/IUrcot 6hAWtFph X-Received: by 2002:a17:902:d50e:b0:2b0:5520:f497 with SMTP id d9443c01a7336-2b28164ceeemr9170775ad.9.1775168036082; Thu, 02 Apr 2026 15:13:56 -0700 (PDT) MIME-Version: 1.0 References: <0c28fbd1-3320-4e9b-815c-6d62753aa063@wi3ck.info> In-Reply-To: From: Masahiko Sawada Date: Thu, 2 Apr 2026 15:13:18 -0700 X-Gm-Features: AQROBzCOQwoR6UyrSzq7HLrYalU7p32yNPHXpi12FgNzym9KEDD7tNWatEZTzys Message-ID: Subject: Re: Initial COPY of Logical Replication is too slow To: Peter Smith Cc: "Zhijie Hou (Fujitsu)" , 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 On Wed, Apr 1, 2026 at 11:12=E2=80=AFPM Peter Smith = wrote: > > Hi Sawada-San > > Some review comments for v8-0001. > > =3D=3D=3D=3D=3D=3D > 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" > > =3D=3D=3D=3D=3D=3D > 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 !=3D 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 =3D=3D RELKIND_SEQUENCE) > ret =3D false; > else > ret =3D 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 th= e > + * 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, ze= ro > + * 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? > > =3D=3D=3D=3D=3D=3D > 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. > > =3D=3D=3D=3D=3D=3D > 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 =3D true); > > Why is this publication called '...no_viaroot' when > publish_via_partition_root =3D true? > > ~~~ > > 7. > +-- test for the EXCLUDE clause > > Typo? /EXCLUDE clause/EXCEPT clause/ > Thank you for the comments! I've pushed the patch after incorporating these points. Regards, --=20 Masahiko Sawada Amazon Web Services: https://aws.amazon.com