Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q70kA-0003IU-UV for pgsql-general@arkaria.postgresql.org; Wed, 07 Jun 2023 21:31:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q70k9-0001oy-Ry for pgsql-general@arkaria.postgresql.org; Wed, 07 Jun 2023 21:31:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q70k9-0001gx-C1 for pgsql-general@lists.postgresql.org; Wed, 07 Jun 2023 21:31:01 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q70k6-000mBm-Ua for pgsql-general@lists.postgresql.org; Wed, 07 Jun 2023 21:31:00 +0000 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-30e5289105cso881175f8f.1 for ; Wed, 07 Jun 2023 14:30:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ardentperf-com.20221208.gappssmtp.com; s=20221208; t=1686173457; x=1688765457; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=3BPN7Hb0BzvZPxbNmXBSqbzDeySdwzpKb101yzRvuwc=; b=t6YEvIvW/tCf/vfBzRd18yZBaYzisJaA8GnKe2KLv0maq9Ono6HUhvlTwxPlkarElz 2quSmYluUtX6lQT2TEuiVru9fEdRZxcpfeWGSSRyugMQmw1Z6AmLdzk51+7lDqq+i4SI cDT6YLvtS5vwj9bBvUrC1Mj2oybS9S6vo1pVEUOTu3WiAs3SguDZBbkyFYbH2WqGtWkU 6QGyJEDz8uEt5v3mqI7cqNpvEolk78dUUnAbWf6kCzJc2yhP2KsUIgGovweQCJtDgTar fQh/AQxrbqTKsIcwEF4jTeLTcqFIfmPojG/vW6YIM/Uzfh4YyeDvPSQ0RAREZOtqhtch aSmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686173457; x=1688765457; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3BPN7Hb0BzvZPxbNmXBSqbzDeySdwzpKb101yzRvuwc=; b=MrI03dqVAw9z9RuT8pjPbCAJFkvn9dHQXcU5jXVP3l+iih2L7d2TpvYJP8TZNeI1l7 z2+U6Fcyun0VyR81GEudtj4GuqFEHi4KTmK+cSjx88mVfOZKEb67w1C7Ywx5bYpMvFUJ mTrsUfzJJIiNHclz+vEvIPELHnwqaa/o0g+GJGu/JPEuAMLT0P5qDjd6zqZB3Nx/5PJa tH6vrfx70RqXcAbfb9EbAkjGXP2khLVT55En6Vz/KdVTP0v13FXe2Q5xB/8KkE0Wz6jo n0AtOH8QeGibbrxRvtDMUpAcTnOOb+nNSmyE6TwcVckY7AK6rke4HU6ie5PlveKdlfaZ o0Ow== X-Gm-Message-State: AC+VfDz9pzyQoOFFbgzRkBmlvJ7X8fBAQpI7PL4AoT29KkaBrcw2GFxA qpt5J0DGAZgJRv2eZJpI1nil85L9REK/WwQFJEcr1Q== X-Google-Smtp-Source: ACHHUZ7bn9lyOPB3wyaRB4O2zBH3JquKWQWr5/rjVO1od1kwmp5NUsXbkUQJ8usPz0fzNf1tbAlClQ== X-Received: by 2002:adf:ef91:0:b0:30e:5bf2:ef1b with SMTP id d17-20020adfef91000000b0030e5bf2ef1bmr157381wro.25.1686173457445; Wed, 07 Jun 2023 14:30:57 -0700 (PDT) Received: from [192.168.27.166] ([54.239.6.187]) by smtp.gmail.com with ESMTPSA id p14-20020a5d638e000000b0030e5bd253aasm2476021wru.39.2023.06.07.14.30.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 Jun 2023 14:30:57 -0700 (PDT) Message-ID: Date: Wed, 7 Jun 2023 14:30:53 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: Native Logical Replication Initial Import Qs Content-Language: en-US To: Don Seiler , "pgsql-generallists.postgresql.org" References: From: Jeremy Schneider In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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