1

I've set up a simple postgres-10 logical replication publication

CREATE PUBLICATION active_directory_pub FOR TABLE active_directory.security_principal;

It's just a table with about 50,000 rows. However, when I try to subscribe to this publication from a separate database on the local host, the initial synchronization seems to take a very, very long time (hours and still going).

Is this expected? Do I need to set up some indexes to speed things up? Are there options or pre-loading I can do to help it along?

nclu
  • 1,057
  • 1
  • 8
  • 19

1 Answers1

1

Do you have any errors in either the sender or receiver's logs? You can check out pg_stat_subscription and see what is being worked on.

I don't think indexes would help you speed things up; in fact it may do the opposite.

Beyond this basic advice, I don't know what else we can give you without more information specific to your system and the table structure.

As for pre-loading, you are welcome to create a new subscription with the copy_data option set to false and manually load the data yourself before re-enabling the subscription.

user3186332
  • 345
  • 3
  • 13
  • It was my mistake. Because the replication was on the same host, the slot had to be set up manually. – nclu Jul 13 '18 at 18:39