COPY with fk's slow - Mailing list pgsql-general

From John Smith
Subject COPY with fk's slow
Date
Msg-id 20030206072122.99305.qmail@web40702.mail.yahoo.com
Whole thread Raw
Responses Re: COPY with fk's slow
List pgsql-general

I'm playing around with importing 10,000 records into a table with a single index and a single foreign key. COPY takes roughly 10 minutes(!). However, if I drop the foreign key, COPY takes a couple seconds, THEN adding the foreign key back takes another few seconds. Any idea why COPY with a f/k takes so much longer? Any workarounds? Such as lock the table, drop fk, copy, add fk, unlock?

John

 



Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

pgsql-general by date:

Previous
From: Curt Sampson
Date:
Subject: Re: Temporary and permanent tables with same name
Next
From: "Nigel J. Andrews"
Date:
Subject: Re: Deleting orphan records