Re: postgresql multiple insert slow - Mailing list pgsql-sql

From Tom Lane
Subject Re: postgresql multiple insert slow
Date
Msg-id 11942.1077379425@sss.pgh.pa.us
Whole thread Raw
In response to postgresql multiple insert slow  ("Michael L. Hostbaek" <mich@freebsdcluster.org>)
List pgsql-sql
"Michael L. Hostbaek" <mich@freebsdcluster.org> writes:
> I runs fine - and I get no errors - but it takes almost 25 minutes to
> complete.. I tried running the script while just grabbing the rows from
> the oracle database and writing to a text file - and then it only takes
> a couple of minutes .. So it must be the INSERT command that chokes - is
> there a better way to do it ? 

You probably want to add BEGIN/COMMIT operations around the loop.  See
the documentation's tips on bulk data loading:
http://www.postgresql.org/docs/7.4/static/populate.html
        regards, tom lane


pgsql-sql by date:

Previous
From: "V i s h a l Kashyap @ [Sai Hertz And Control Systems]"
Date:
Subject: Re: Function
Next
From: Tom Lane
Date:
Subject: Re: Function