Re: COPY versus INSERT - Mailing list pgsql-general

From scott.marlowe
Subject Re: COPY versus INSERT
Date
Msg-id Pine.LNX.4.33.0305140925210.30919-100000@css120.ihs.com
Whole thread Raw
In response to COPY versus INSERT  ("Jay O'Connor" <joconnor@cybermesa.com>)
List pgsql-general
On Tue, 13 May 2003, Jay O'Connor wrote:

> I'm loading a database with a lot of data from an external source (I'm
> convertin all my data to postgresql)
>
> Right now I'm just connecting to the database and issuing a whole lot of
> INSERTS and this is taking longer than I had planned.
>
> Would it be faster to just dump my database ina tab delimited format and
> use a COPY FROM or psql /copy command?

Speed wise, here's my take on what's faster:

copy = X time.
insert 10,000 rows at a time in transactions:  2-10X time
insert all rows in autocommit, i.e. single transactions:  (10^100)X

Of course, that last one is an exageration, but honestly, when you're
waiting on it, it feels that way. :-)


pgsql-general by date:

Previous
From: Dennis Gearon
Date:
Subject: Re: fomatting an interval (resend)
Next
From: Stephan Szabo
Date:
Subject: Re: query help