Re: Best COPY Performance

Поиск
Список
Период
Сортировка
От Craig A. James
Тема Re: Best COPY Performance
Дата
Msg-id 453EF7C4.2040105@modgraph-usa.com
обсуждение исходный текст
Ответ на Re: Best COPY Performance  ("Jim C. Nasby" <jim@nasby.net>)
Ответы Re: Best COPY Performance
Re: Best COPY Performance
Postgres server crash
Список pgsql-performance
Jim C. Nasby wrote:
> Well, given that perl is using an entire CPU, it sounds like you should
> start looking either at ways to remove some of the overhead from perl,
> or to split that perl into multiple processes.

I use Perl for big database copies (usually with some processing/transformation along the way) and I've never seen 100%
CPUusage except for brief periods, even when copying BLOBS and such.  My typical copy divides operations into blocks,
forexample doing 

  N = 0
  while (more rows to go) {
     begin transaction
     select ... where primary_key > N order by primary_key limit 1000
     while (fetch a row)
        insert into ...
     N = (highest value found in last block)
     commit
   }

Doing it like this in Perl should keep Postgres busy, with Perl using only moderate resources.  If you're seeing high
PerlCPU usage, I'd look first at the Perl code. 

Craig

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

Предыдущее
От: "Worky Workerson"
Дата:
Сообщение: Re: Best COPY Performance
Следующее
От: Alex Stapleton
Дата:
Сообщение: Re: Best COPY Performance