Re: COPY threads

Поиск
Список
Период
Сортировка
От Christopher Browne
Тема Re: COPY threads
Дата
Msg-id CAFNqd5UMtCNiHsMLkirywcZC=QOE=ThEy1ABn6-+rVC5j73g3Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: COPY threads  (Ravi Krishna <srkrishna1@aol.com>)
Ответы Re: COPY threads  (Ravi Krishna <srkrishna1@aol.com>)
Список pgsql-general
On Wed, 10 Oct 2018 at 16:22, Ravi Krishna <srkrishna1@aol.com> wrote:
> You obviously are referring to multiple connections running COPY on different tables, right?  Like what pg_restore
doeswith -j option.
 
> Doesn't copy take an exclusive lock on the table which makes it incompatible with parallelization.

No, why would that seem to be the case?  If it did so, then you could
not run pg_dump to dump data while regular activity was going on.

That's decidedly not the case.

The challenge in parallelizing a dump via COPY TO is in ensuring that
the multiple requests are attached to the same serializable
transaction.  There's a function now that allows multiple connections
to attach to the same transaction context, I believe...  Also, there's
the challenge in actually splitting the data, so that both requests
are dumping different data; that might be fairly expensive whether
with or without indices.

-- 
When confronted by a difficult problem, solve it by reducing it to the
question, "How would the Lone Ranger handle this?"


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

Предыдущее
От: Ravi Krishna
Дата:
Сообщение: Re: COPY threads
Следующее
От: Ravi Krishna
Дата:
Сообщение: Re: COPY threads