Re: Issues with \copy from file

Поиск
Список
Период
Сортировка
От Euler Taveira de Oliveira
Тема Re: Issues with \copy from file
Дата
Msg-id 4ADAA8A7.9050704@timbira.com
обсуждение исходный текст
Ответ на Issues with \copy from file  (Sigurgeir Gunnarsson <sgunnars@gmail.com>)
Список pgsql-performance
Sigurgeir Gunnarsson escreveu:
> What I'm wondering about is what parameters to tweak to improve the
> operation and shorten the time of the \copy ? I think I have tweaked
> most of the available in postgresql.conf, that is shared_buffer,
> temp_buffers, work_mem, maintenance_work_mem, max_fsm_pages. Maybe
> someone could point out the one really related to \copy ?
>
You don't show us your table definitions. You don't say what postgresql
version you're using. Let's suppose archiving is disabled, you're bulk loading
table foo and, you're using version >= 8.3. Just do:

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

PostgreSQL will skip WAL writes and just fsync() the table at the end of the
command.

Also, take a look at [1].

[1] http://www.postgresql.org/docs/current/interactive/populate.html


--
  Euler Taveira de Oliveira
  http://www.timbira.com/

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

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: sequential scan on child partition tables
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Issues with \copy from file