Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-sql by date

Next:From: Tom LaneDate: 2004-02-21 16:10:55
Subject: Re: Function
Previous:From: Christopher BrowneDate: 2004-02-21 15:03:53
Subject: Re: postgresql multiple insert slow

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group