| From: | Peter Smith <smithpb2250(at)gmail(dot)com> |
|---|---|
| To: | Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> |
| Cc: | "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Jan Wieck <jan(at)wi3ck(dot)info>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Initial COPY of Logical Replication is too slow |
| Date: | 2026-04-02 06:12:03 |
| Message-ID: | CAHut+Pue4v3hVjCF0FNVHVn4-ZXdm05AXoU3RJJpYXjn2fs_jw@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
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/
Kind Regards,
Peter Smith.
Fujitsu Australia
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Amit Kapila | 2026-04-02 06:34:18 | Re: Use SIGTERM instead of SIGUSR1 for slotsync worker to exit during promotion? |
| Previous Message | Amit Kapila | 2026-04-02 05:45:21 | Re: Initial COPY of Logical Replication is too slow |