Re: Issues with \copy from file - Mailing list pgsql-performance

From Euler Taveira de Oliveira
Subject Re: Issues with \copy from file
Date
Msg-id 4ADAA8A7.9050704@timbira.com
Whole thread Raw
In response to Issues with \copy from file  (Sigurgeir Gunnarsson <sgunnars@gmail.com>)
List 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 by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: sequential scan on child partition tables
Next
From: Scott Marlowe
Date:
Subject: Re: Issues with \copy from file