Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gURSf-0004aX-9d for pgsql-general@arkaria.postgresql.org; Wed, 05 Dec 2018 07:19:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gURSd-0002G8-GT for pgsql-general@arkaria.postgresql.org; Wed, 05 Dec 2018 07:19:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gURSc-0002G0-Bv for pgsql-general@lists.postgresql.org; Wed, 05 Dec 2018 07:19:06 +0000 Received: from mail-it1-x12e.google.com ([2607:f8b0:4864:20::12e]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gURSY-0005En-Ds for pgsql-general@postgresql.org; Wed, 05 Dec 2018 07:19:04 +0000 Received: by mail-it1-x12e.google.com with SMTP id p197so18744678itp.0 for ; Tue, 04 Dec 2018 23:19:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=GyMvgYP7hdrh8yt87m/A777tecx0D5hIOTwoLqv39F8=; b=k+BnRUXM0kAUAFvgvzrUounFImnM+VDTGVN6xfaF3JcGwwuORwEcmF+i2lbcrUMeQr yhgXgaiQsz4XBKMUPRLBzBaInu8d3faAce2KX8fDiOKH3C3nhJfgqeIQsIOTywystlAy b1bvqa+YP/nLM169EbBetKcfPJSZLwxODi23hyHiscFOywan29HBLkR4elk+n8vMJnCS zjyAA7xi3GR4VqBfpWDrzCr0CJUVOEuuAOQo78BH+S/DQrK5vBKpamoQo1ZGDGVooKmE 6FVgB9vI+tUaLJU201yEMdsPIEOJT4xmo8k5GwD8W9hhxB+kjYK3QC7E2KQIQ6kAPoa7 SUmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=GyMvgYP7hdrh8yt87m/A777tecx0D5hIOTwoLqv39F8=; b=ksXPXd5H0zFH8K9zHTeTMt7OKQ7RGMpmlmw+lKhizADXUPM1maRdjMSgEPjuWw4vbZ c4Y9S2pDAuV9WVm7qtuxEjlNzXEGmXHljbUv9IhNa8jTeb20Lt22Io6eEGSUwaIcRoZz OeQm80yZzq4cayCCcRBwrYfYnxXuP7bbnXeQfPAweo7frxzQcW+lQhfncXPVGjfCaMMq e6fyGp8UO4hlbalLE+LMIKfOmA3hca6INiwvTMkHP/aZx0jCjUK/F1iwBzd73IHBYhtc sXHvQOuJFDuNlUO517Xpr04F3EG//JoLgfwODEKFo8AOVQShfKduTFeCRR6uzjKluREU KiLA== X-Gm-Message-State: AA+aEWZ14NT24Enf6xuxYfUBgXXbHa4RK6i85gGdKxk66mPLBicMX4d7 BtZiFRuIlrvUrYcTxL4B7QYq6L1z X-Google-Smtp-Source: AFSGD/VNyS1Q1Ah12z6paA9J7p70Rhgna3rPSKCFrih+hSywHyknppVxPqxhEqD+VBv4ayaNw9PHCg== X-Received: by 2002:a02:9d27:: with SMTP id n36mr20094927jak.30.1543994340935; Tue, 04 Dec 2018 23:19:00 -0800 (PST) Received: from ?IPv6:2601:681:5500:1e3c:3dc2:5e35:b279:6f1e? ([2601:681:5500:1e3c:3dc2:5e35:b279:6f1e]) by smtp.gmail.com with ESMTPSA id a20sm3491549ioo.44.2018.12.04.23.19.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Dec 2018 23:19:00 -0800 (PST) Content-Type: multipart/alternative; boundary=Apple-Mail-DBC90463-4105-4CD6-93D7-D480D7E69BE6 Mime-Version: 1.0 (1.0) Subject: Re: Moving large table between servers: logical replication or postgres_fdw From: Rob Sargent X-Mailer: iPhone Mail (16B92) In-Reply-To: Date: Wed, 5 Dec 2018 00:18:59 -0700 Cc: rhys.stewart@gmail.com, pgsql-general@postgresql.org Content-Transfer-Encoding: 7bit Message-Id: <50F5075B-680E-4A98-A133-40D684C2D53F@gmail.com> References: To: Rene Romero Benavides List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail-DBC90463-4105-4CD6-93D7-D480D7E69BE6 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable L > On Dec 4, 2018, at 11:13 PM, Rene Romero Benavides wrote: >=20 > I tend to believe that a backup (pg_dump) in custom format (-F c) using mu= ltiple jobs (parallel) -> restore (pg_restore) also with multiple concurrent= jobs would be better. >=20 >> Am Di., 4. Dez. 2018 um 21:14 Uhr schrieb Rhys A.D. Stewart : >> Greetings Folks, >>=20 >> I have a relatively large table (100m rows) that I want to move to a >> new box with more resources. The table isn't doing anything...i.e its >> not being updated or read from. Which approach would be faster to move >> the data over: >>=20 >> a). Use pg_fdw and do "create local_table as select * from foreign_tabl= e". >> b). setup logical replication between the two servers. >>=20 >> Regards, >>=20 >> Rhys >> Peace & Love|Live Long & Prosper >>=20 >=20 >=20 > --=20 > El genio es 1% inspiraci=C3=B3n y 99% transpiraci=C3=B3n. > Thomas Alva Edison > http://pglearn.blogspot.mx/ > L >=20 Let=E2=80=99s compromise. Copy out as described. Tell the auditors where the= file is. Skip the copy in.=20 If you truly don=E2=80=99t need the data online going forward this might act= ually pass muster.=20= --Apple-Mail-DBC90463-4105-4CD6-93D7-D480D7E69BE6 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
L

On Dec 4, 2018, at 11:13 PM, Rene Romero Benavides &= lt;rene.romero.b@gmail.com>= ; wrote:

I tend to believe that a backup (pg_dump) in custom format (-F c) usin= g multiple jobs (parallel) -> restore (pg_restore) also with multiple con= current jobs would be better.

Am Di., 4. Dez. 2018 um 21:14 Uhr schrieb Rhys A.D. Stewart <<= a href=3D"mailto:rhys.stewart@gmail.com">rhys.stewart@gmail.com>:
=
Greetings Folks,

I have a relatively large table (100m rows) that I want to move to a
new box with more resources. The table isn't doing anything...i.e its
not being updated or read from. Which approach would be faster to move
the data over:

  a). Use pg_fdw and do "create local_table as select * from foreign_ta= ble".
  b). setup logical replication between the two servers.

Regards,

Rhys
Peace & Love|Live Long & Prosper



--
El genio es 1% i= nspiraci=C3=B3n y 99% transpiraci=C3=B3n.
Thomas Alva Edison
http://pglearn.blogspot.mx/<= /a>
L

L= et=E2=80=99s compromise. Copy out as described. Tell the auditors where the f= ile is. Skip the copy in. 
If you truly don=E2=80=99t need t= he data online going forward this might actually pass muster. 
= --Apple-Mail-DBC90463-4105-4CD6-93D7-D480D7E69BE6--