Re: bulk insert performance problem

Matthew Wakeling <matthew@flymine.org>

From: Matthew <matthew@flymine.org>
To: pgsql-performance@postgresql.org
Date: 2008-04-08T14:00:13Z
Lists: pgsql-performance
On Tue, 8 Apr 2008, Mark Stosberg wrote:
>> Any idea? Is there any other improvements I could do?
>
> Are you using the "COPY" syntax in the import script or individual insert 
> statements? Using COPY will always be *much* faster.

PostgreSQL (latest versions at least) has an optimisation if you create a 
table in the same transaction as you load data into it. So, if you have a 
database dump, load it in using psql -1, which wraps the entire operation 
in a single transaction. Of course, a COPY dump will load a lot faster 
than a INSERT dump.

Matthew

-- 
What goes up must come down. Ask any system administrator.