Re: Issues with \copy from file

From: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
To: Sigurgeir Gunnarsson <sgunnars(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Issues with \copy from file
Date: 2009-10-18 05:33:27
Message-ID: 4ADAA8A7.9050704@timbira.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Scott Marlowe 2009-10-18 06:10:30 Re: Issues with \copy from file
Previous Message Scott Marlowe 2009-10-18 05:08:46 Re: sequential scan on child partition tables