From: Jeremy Schneider <schneider@ardentperf.com>
To: Don Seiler <don@seiler.us>
To: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Native Logical Replication Initial Import Qs
Date: Wed, 7 Jun 2023 14:30:53 -0700
Message-ID: <c4511271-a6b4-2315-17c4-ef59b5ac21fa@ardentperf.com> (raw)
In-Reply-To: <CAHJZqBB7JuhXca=EE1vJqFU_Ft6uahPDj-Bj4wuSpntZzgdf_g@mail.gmail.com>
References: <CAHJZqBB7JuhXca=EE1vJqFU_Ft6uahPDj-Bj4wuSpntZzgdf_g@mail.gmail.com>
On 6/7/23 2:12 PM, Don Seiler wrote:
> On the logical replication front, the concern is with the initial data
> import that happens when the subscription is created (by default). I
> know that you can tell the subscription to not copy data and instead use
> pg_dump and a replication slot snapshot to achieve this manually.
> However I'm unable to explain (to myself) why this is better than just
> having the subscription do it upon creation. Given that I can create
> pub/sub sets for individual tables for parallel operations, I'm curious
> what advantages there are in using pg_dump to do this import.
FWIW, I think the place this feature shines the most is when you can
safely leverage things like storage-level snapshots. Sometimes that
means you can get a copy of a multi-TB database almost instantly if the
storage or filesystem does copy-on-write, for example database lab
(postgres.ai) which uses ZFS.
Another thing I can think of is that while it's true you can create
multiple pub/sub sets, I'm not sure you can reduce the number of sets
later. So if you were concerned about having too many slots doing
decoding on the source, then you might want the flexibility of pg_dump
(or perhaps restoring a backup) to get more parallelism while having
more control over how many slots will be used later.
In your case, the whole setup is hopefully temporary, so maybe these
particular concerns aren't as relevant to you.
This is just what comes to mind... probably there's a few more things
I'm not thinking of and hopefully others will chime in. :)
-Jeremy
--
http://about.me/jeremy_schneider
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: schneider@ardentperf.com, don@seiler.us
Subject: Re: Native Logical Replication Initial Import Qs
In-Reply-To: <c4511271-a6b4-2315-17c4-ef59b5ac21fa@ardentperf.com>
References: <CAHJZqBB7JuhXca=EE1vJqFU_Ft6uahPDj-Bj4wuSpntZzgdf_g@mail.gmail.com> <c4511271-a6b4-2315-17c4-ef59b5ac21fa@ardentperf.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox