X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2408A5296B for ; Thu, 14 Apr 2005 12:25:58 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 09042-02 for ; Thu, 14 Apr 2005 15:25:45 +0000 (GMT) Received: from localhost.net (cust.89.121.adsl.cistron.nl [195.64.89.121]) by svr1.postgresql.org (Postfix) with ESMTP id 4975F53B40 for ; Thu, 14 Apr 2005 12:25:44 -0300 (ADT) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost.net (Postfix) with ESMTP id 4967819B3C0; Thu, 14 Apr 2005 17:25:38 +0200 (CEST) Message-ID: <425E8B70.2060006@trust-factory.com> Date: Thu, 14 Apr 2005 17:25:36 +0200 From: Richard van den Berg Organization: Trust Factory User-Agent: Debian Thunderbird 1.0 (X11/20050116) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Christopher Kings-Lynne Cc: pgsql-performance@postgresql.org Subject: Re: Foreign key slows down copy/insert References: <425E6045.4060201@trust-factory.com> <425E792B.4020500@familyhealth.com.au> <425E7D96.6020201@trust-factory.com> <425E7F94.4080602@familyhealth.com.au> <425E8766.8070901@trust-factory.com> <425E88B7.6000203@familyhealth.com.au> In-Reply-To: <425E88B7.6000203@familyhealth.com.au> X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200504/289 X-Sequence-Number: 11686 Christopher Kings-Lynne wrote: > No it certainly won't warn you. You have _avoided_ the check entirely. > That's why I was warning you... I figured as much when I realized it was just a simple table update. I was thinking more of a DB2 style "set integrity" command. > If you wanted to be really careful, you could: So I will be re-checking my own FKs. That's not really what I'd expect from a FK. My problem with this really is that in my database it is hard to predict which inserts will be huge (and thus need FKs dissabled), so I would have to code it around all inserts. Instead I can code my own integirty logic and avoid using FKs all together. Thanks, -- Richard van den Berg, CISSP ------------------------------------------- Trust Factory B.V. | www.dna-portal.net Bazarstraat 44a | www.trust-factory.com 2518AK The Hague | Phone: +31 70 3620684 The Netherlands | Fax : +31 70 3603009 ------------------------------------------- Have you visited our new DNA Portal? -------------------------------------------