On Wednesday 14 May 2003 3:23 am, 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?
Almost always.
Might want to try batching your INSERTs into transactions of a few hundred-few
thousand first though - that frequently helps a lot:
BEGIN;
INSERT ...1
INSERT ...2
...
INSERT ...999
COMMIT;
--
Richard Huxton