pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedMoving large table between servers: logical replication or postgres_fdw
7+ messages / 4 participants
[nested] [flat]
* Moving large table between servers: logical replication or postgres_fdw
@ 2018-12-05 03:14 Rhys A.D. Stewart <rhys.stewart@gmail.com>
2018-12-05 06:05 ` Re: Moving large table between servers: logical replication or postgres_fdw Rob Sargent <robjsargent@gmail.com>
2018-12-05 06:13 ` Re: Moving large table between servers: logical replication or postgres_fdw Rene Romero Benavides <rene.romero.b@gmail.com>
2018-12-05 06:17 ` Re: Moving large table between servers: logical replication or postgres_fdw Ron <ronljohnsonjr@gmail.com>
0 siblings, 3 replies; 7+ messages in thread
From: Rhys A.D. Stewart @ 2018-12-05 03:14 UTC (permalink / raw)
To: pgsql-general
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
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Moving large table between servers: logical replication or postgres_fdw
2018-12-05 03:14 Moving large table between servers: logical replication or postgres_fdw Rhys A.D. Stewart <rhys.stewart@gmail.com>
@ 2018-12-05 06:05 ` Rob Sargent <robjsargent@gmail.com>
2018-12-05 06:13 ` Re: Moving large table between servers: logical replication or postgres_fdw Ron <ronljohnsonjr@gmail.com>
2 siblings, 1 reply; 7+ messages in thread
From: Rob Sargent @ 2018-12-05 06:05 UTC (permalink / raw)
To: Rhys A.D. Stewart <rhys.stewart@gmail.com>; +Cc: pgsql-general
> On Dec 4, 2018, at 8:14 PM, Rhys A.D. Stewart <rhys.stewart@gmail.com> wrote:
>
> 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
>
Can’t help but think an unread unwritten table goes to quietly to /dev/null :)
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Moving large table between servers: logical replication or postgres_fdw
2018-12-05 03:14 Moving large table between servers: logical replication or postgres_fdw Rhys A.D. Stewart <rhys.stewart@gmail.com>
2018-12-05 06:05 ` Re: Moving large table between servers: logical replication or postgres_fdw Rob Sargent <robjsargent@gmail.com>
@ 2018-12-05 06:13 ` Ron <ronljohnsonjr@gmail.com>
0 siblings, 0 replies; 7+ messages in thread
From: Ron @ 2018-12-05 06:13 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
On 12/05/2018 12:05 AM, Rob Sargent wrote:
>> On Dec 4, 2018, at 8:14 PM, Rhys A.D. Stewart <rhys.stewart@gmail.com> wrote:
>>
>> 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.
> Can’t help but think an unread unwritten table goes to quietly to /dev/null :)
Sigh, no.
The legal and audit teams, and the customer, would be most upset if the data
you're legally obligated to keep for 7 years suddenly disappears.
--
Angular momentum makes the world go 'round.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Moving large table between servers: logical replication or postgres_fdw
2018-12-05 03:14 Moving large table between servers: logical replication or postgres_fdw Rhys A.D. Stewart <rhys.stewart@gmail.com>
@ 2018-12-05 06:13 ` Rene Romero Benavides <rene.romero.b@gmail.com>
2018-12-05 06:23 ` Re: Moving large table between servers: logical replication or postgres_fdw Ron <ronljohnsonjr@gmail.com>
2018-12-05 07:18 ` Re: Moving large table between servers: logical replication or postgres_fdw Rob Sargent <robjsargent@gmail.com>
2 siblings, 2 replies; 7+ messages in thread
From: Rene Romero Benavides @ 2018-12-05 06:13 UTC (permalink / raw)
To: rhys.stewart@gmail.com; +Cc: pgsql-general
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
>
>
--
El genio es 1% inspiración y 99% transpiración.
Thomas Alva Edison
http://pglearn.blogspot.mx/
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Moving large table between servers: logical replication or postgres_fdw
2018-12-05 03:14 Moving large table between servers: logical replication or postgres_fdw Rhys A.D. Stewart <rhys.stewart@gmail.com>
2018-12-05 06:13 ` Re: Moving large table between servers: logical replication or postgres_fdw Rene Romero Benavides <rene.romero.b@gmail.com>
@ 2018-12-05 06:23 ` Ron <ronljohnsonjr@gmail.com>
1 sibling, 0 replies; 7+ messages in thread
From: Ron @ 2018-12-05 06:23 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
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 <mailto: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.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Moving large table between servers: logical replication or postgres_fdw
2018-12-05 03:14 Moving large table between servers: logical replication or postgres_fdw Rhys A.D. Stewart <rhys.stewart@gmail.com>
2018-12-05 06:13 ` Re: Moving large table between servers: logical replication or postgres_fdw Rene Romero Benavides <rene.romero.b@gmail.com>
@ 2018-12-05 07:18 ` Rob Sargent <robjsargent@gmail.com>
1 sibling, 0 replies; 7+ messages in thread
From: Rob Sargent @ 2018-12-05 07:18 UTC (permalink / raw)
To: Rene Romero Benavides <rene.romero.b@gmail.com>; +Cc: rhys.stewart@gmail.com; pgsql-general
L
> On Dec 4, 2018, at 11:13 PM, Rene Romero Benavides <rene.romero.b@gmail.com> 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
>>
>
>
> --
> El genio es 1% inspiración y 99% transpiración.
> Thomas Alva Edison
> http://pglearn.blogspot.mx/
> L
>
Let’s compromise. Copy out as described. Tell the auditors where the file is. Skip the copy in.
If you truly don’t need the data online going forward this might actually pass muster. =
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Moving large table between servers: logical replication or postgres_fdw
2018-12-05 03:14 Moving large table between servers: logical replication or postgres_fdw Rhys A.D. Stewart <rhys.stewart@gmail.com>
@ 2018-12-05 06:17 ` Ron <ronljohnsonjr@gmail.com>
2 siblings, 0 replies; 7+ messages in thread
From: Ron @ 2018-12-05 06:17 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
On 12/04/2018 09:14 PM, Rhys A.D. Stewart wrote:
> 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.
Or KISS and COPY WITH FORMAT BINARY.
--
Angular momentum makes the world go 'round.
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2018-12-05 07:18 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-12-05 03:14 Moving large table between servers: logical replication or postgres_fdw Rhys A.D. Stewart <rhys.stewart@gmail.com>
2018-12-05 06:05 ` Rob Sargent <robjsargent@gmail.com>
2018-12-05 06:13 ` Ron <ronljohnsonjr@gmail.com>
2018-12-05 06:13 ` Rene Romero Benavides <rene.romero.b@gmail.com>
2018-12-05 06:23 ` Ron <ronljohnsonjr@gmail.com>
2018-12-05 07:18 ` Rob Sargent <robjsargent@gmail.com>
2018-12-05 06:17 ` Ron <ronljohnsonjr@gmail.com>
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