Re: bulk insert performance problem - Mailing list pgsql-performance

From Matthew
Subject Re: bulk insert performance problem
Date
Msg-id Pine.LNX.4.64.0804081457200.20402@aragorn.flymine.org
Whole thread Raw
In response to Re: bulk insert performance problem  (Mark Stosberg <mark@summersault.com>)
List 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.

pgsql-performance by date:

Previous
From: Mark Stosberg
Date:
Subject: Re: bulk insert performance problem
Next
From: Richard Huxton
Date:
Subject: Re: Performance with temporary table