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.