Re: Issues with \copy from file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux