0

I am about doing replication for 16 millions record. Just want to ask about the initial phase of logical replication :

  1. Do I need to copy the initial table from publisher to subscriber first ? Or is it handled by the subscription ? I don't know how long will it be if it is handled by the replication process...
  2. Here and some other sites too,https://www.enterprisedb.com/postgres-tutorials/logical-replication-postgresql-explained, it says "... spawn multiple table synchronization workers" How can I spawn multiple table synchronization workers ? Which parameter is it ? None of the articles I read mention parameter for setting sync workers

thanks

Postgres 12 running on Ubuntu

2
  • The material you quote is not located at the indicated link.
    – jjanes
    Aug 10, 2022 at 16:18
  • yes.. sorry. But more or less the same.
    – padjee
    Aug 11, 2022 at 1:18

1 Answer 1

2

re 1)

No, you don't need to do anything. As soon as you create the subscription, Postgres will copy the data. You can prevent the initial copy if you wanted to, by using with (copy_data = false) when creating the subscription.

re 2)

Then number of background processes for logical replication isn't controlled per subscription, but system wide on the subscriber through max_logical_replication_workers and max_sync_workers_per_subscription.

However for a single table only a single worker will be used.

Currently, there can be only one synchronization worker per table.

So, increasing max_sync_workers_per_subscription only affects the number of tables that are synchronized in parallel, not the number of workers per table.

1
  • hi @a_horse_with_no_name , thanks indeed. It opens up another question : Is there any situation where the number of subscription is greater than max_logical_replication_workers ? What happen if it does ?
    – padjee
    Aug 10, 2022 at 6:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.