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 1gUQab-0001ak-K3 for pgsql-general@arkaria.postgresql.org; Wed, 05 Dec 2018 06:23:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gUQaa-0008UV-3x for pgsql-general@arkaria.postgresql.org; Wed, 05 Dec 2018 06:23:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gUQaZ-0008UO-QH for pgsql-general@lists.postgresql.org; Wed, 05 Dec 2018 06:23:15 +0000 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gUQaS-0007FV-Ko for pgsql-general@lists.postgresql.org; Wed, 05 Dec 2018 06:23:15 +0000 Received: by mail-ot1-x333.google.com with SMTP id a11so17605272otr.10 for ; Tue, 04 Dec 2018 22:23:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=OrRZs4K6Gr9MC9tSK/b+ZHa0kGAwc6C7mKnf29xKWXM=; b=gPABrzu/Imvhn1MbURCLaLFjeDd/wJSEW8/6hRMmERydLp7ktyi4l2Wyy2ciNeobp7 RmeaQerGgMjAfMQI415dxJukHf/7JWOHrfNjpShzv3W9Y27gdG9W9pqD1iv6JeqXpAwO JKlP9qLVFBqMEdZnQ/ipQy50TTKnPGxrlH2p3IGjVh7eUfyIRbzyP3jio/kp7cOhcIi2 rhu3j+SAl3Nar8j/NDacNAx8nbvbi+MzMzcpBEW9tFBIDyYBn/gmrSedz6NLW2WZ/Wem N72a0CqFDPbTmMVOKVNGJ/dOWOufWTMiBYlQQ9GFJouobKnt1NKvnOkPoLoTIxEwILqi u57w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=OrRZs4K6Gr9MC9tSK/b+ZHa0kGAwc6C7mKnf29xKWXM=; b=mp93YlEYn9OkU5HLik229iO4AyJZrLTsW1Ii1VTsKSblzfQghpTDD0wYAlMMiF25Dn lqkgROrHm4D41Va5tNiX+F4APgqS/vmGumBTYFv1QKHS8IojGQ4bRbFnv0ne/CHM2U36 j6/fEHzBPSL4QI08GtYc6fCzhqvIFqQ5iU3DvAJZDYUJ8IEfQzthoVPnycbqzz/97PSk +1bpfULkYaEttwdDcRkqb83OGtidTqvj6Pp21eAi8ITlW5fOn/yGlKWA1zQWZ9icjYgi /UmSyz1n3vxJHZvfGVO7bCt1XgCB9OHLUeZe3vw1Va3GsueXr4EpBEFfTffd8fsOZ1/U 51vA== X-Gm-Message-State: AA+aEWalyVMrPxfNPL+jB79W/Bdna1UpTnB0kvAiIJZKQ6wQGYJFMOpK 4dIs2RxPVNMzg7zMqFSgli8yJSDK X-Google-Smtp-Source: AFSGD/WVVJy/CUcg1VhF+3fJWgkajc6IZFJF2yoxZO3ojHmp+FMjj3APbXUd/W8gGBE7Gdqd0cDcaA== X-Received: by 2002:a9d:7dd5:: with SMTP id k21mr15269338otn.214.1543990986030; Tue, 04 Dec 2018 22:23:06 -0800 (PST) Received: from [192.168.1.10] (ip70-171-116-89.no.no.cox.net. [70.171.116.89]) by smtp.googlemail.com with ESMTPSA id q25sm10086790otg.70.2018.12.04.22.23.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Dec 2018 22:23:05 -0800 (PST) Subject: Re: Moving large table between servers: logical replication or postgres_fdw To: pgsql-general@lists.postgresql.org References: From: Ron Message-ID: Date: Wed, 5 Dec 2018 00:23:04 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------3E8C7EECF4516FB2CAE52861" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------3E8C7EECF4516FB2CAE52861 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit pg_backup/pg_restore will work, but parallel is pointless on a single (unpartitioned) table. On 12/05/2018 12:13 AM, Rene Romero Benavides wrote: > I tend to believe that a backup (pg_dump) in custom format (-F c) using > multiple jobs (parallel) -> restore (pg_restore) also with multiple > concurrent jobs would be better. > > Am Di., 4. Dez. 2018 um 21:14 Uhr schrieb Rhys A.D. Stewart > >: > > 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_table". >   b). setup logical replication between the two servers. > > Regards, > > Rhys > Peace & Love|Live Long & Prosper > > -- Angular momentum makes the world go 'round. --------------3E8C7EECF4516FB2CAE52861 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit pg_backup/pg_restore will work, but parallel is pointless on a single (unpartitioned) table.

On 12/05/2018 12:13 AM, Rene Romero Benavides wrote:
I tend to believe that a backup (pg_dump) in custom format (-F c) using multiple jobs (parallel) -> restore (pg_restore) also with multiple concurrent jobs would be better.

Am Di., 4. Dez. 2018 um 21:14 Uhr schrieb Rhys A.D. Stewart <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_table".
  b). setup logical replication between the two servers.

Regards,

Rhys
Peace & Love|Live Long & Prosper



--
Angular momentum makes the world go 'round.
--------------3E8C7EECF4516FB2CAE52861--