COPY with fk's slow

From: John Smith <john_smith_45678(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: COPY with fk's slow
Date: 2003-02-06 07:21:22
Message-ID: 20030206072122.99305.qmail@web40702.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nigel J. Andrews 2003-02-06 07:36:47 Re: Deleting orphan records
Previous Message Curt Sampson 2003-02-06 06:37:46 Re: Temporary and permanent tables with same name