Re: postgresql multiple insert slow

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Michael L(dot) Hostbaek" <mich(at)freebsdcluster(dot)org>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: postgresql multiple insert slow
Date: 2004-02-21 16:03:45
Message-ID: 11942.1077379425@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-sql

"Michael L. Hostbaek" <mich(at)freebsdcluster(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2004-02-21 16:10:55 Re: Function
Previous Message Christopher Browne 2004-02-21 15:03:53 Re: postgresql multiple insert slow