Re: How to copy rows into same table efficiently

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: How to copy rows into same table efficiently
Дата
Msg-id CAKFQuwY1yFQw=yryUyJbKhaYhFsQrX97rp46SYU0y=4Zvuc5gw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to copy rows into same table efficiently  (Ron <ronljohnsonjr@gmail.com>)
Список pgsql-general
On Tue, Oct 26, 2021 at 2:06 AM Ron <ronljohnsonjr@gmail.com> wrote:
Anyway, for millions of rows, I might use COPY instead of INSERT (depending
on how many millions, how many indices, how large the rows, how fast the
machine, etc.


I don't imagine using COPY TO to write the data to a file and then COPY FROM to import it is going to be an improvement over INSERT-SELECT.

Now, if you can perform the COPY TO on a replica and then only run the COPY FROM on the primary that might be worth it.  Avoiding the I/O for the read on the primary would be a big win.

David J.

В списке pgsql-general по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Determining if a table really changed in a trigger
Следующее
От: Marcos Pegoraro
Дата:
Сообщение: Re: Determining if a table really changed in a trigger