Re: Issues with \copy from file

Поиск
Список
Период
Сортировка
От Matthew Wakeling
Тема Re: Issues with \copy from file
Дата
Msg-id alpine.DEB.2.00.0910191030230.19472@aragorn.flymine.org
обсуждение исходный текст
Ответ на Re: Issues with \copy from file  (Scott Marlowe <scott.marlowe@gmail.com>)
Ответы Re: Issues with \copy from file  (Sigurgeir Gunnarsson <sgunnars@gmail.com>)
Список pgsql-performance
On Sun, 18 Oct 2009, Scott Marlowe wrote:
> You can only write data then commit it so fast to one drive, and that
> speed is usually somewhere in the megabyte per second range.  450+150
> in 5 minutes is 120 Megs per second, that's pretty fast, but is likely
> the max speed of a modern super fast 15k rpm drive.  If it's taking 20
> minutes then it's 30 Megs per second which is still really good if
> you're in the middle of a busy afternoon and the db has other things
> to do.

You're out by a factor of 60. That's minutes, not seconds.

More relevant is the fact that Postgres will normally log changes in the
WAL, effectively writing the data twice. As Euler said, the trick is to
tell Postgres that noone else will need to see the data, so it can skip
the WAL step:

> BEGIN;
> TRUNCATE TABLE foo;
> COPY foo FROM ...;
> COMMIT;

I see upward of 100MB/s over here when I do this.

Matthew

--
 Patron: "I am looking for a globe of the earth."
 Librarian: "We have a table-top model over here."
 Patron: "No, that's not good enough. Don't you have a life-size?"
 Librarian: (pause) "Yes, but it's in use right now."

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

Предыдущее
От: Grzegorz Jaśkiewicz
Дата:
Сообщение: Re: Partitioned Tables and ORDER BY
Следующее
От: Joe Uhl
Дата:
Сообщение: Re: Performance with sorting and LIMIT on partitioned table