Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id C420B633587 for ; Wed, 10 Feb 2010 11:02:16 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 72575-09-2 for ; Wed, 10 Feb 2010 15:01:57 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 9CFCD634A56 for ; Wed, 10 Feb 2010 10:56:44 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o1AEuemS016010; Wed, 10 Feb 2010 09:56:41 -0500 (EST) To: Franck Routier cc: pgsql-performance@postgresql.org Subject: Re: Deferred constraint and delete performance In-reply-to: <1265799331.28404.14.camel@franck-laptop> References: <1265799331.28404.14.camel@franck-laptop> Comments: In-reply-to Franck Routier message dated "Wed, 10 Feb 2010 11:55:31 +0100" Date: Wed, 10 Feb 2010 09:56:40 -0500 Message-ID: <16009.1265813800@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.536 tagged_above=-10 required=5 tests=AWL=-0.796, BAYES_20=-0.74 X-Spam-Level: X-Archive-Number: 201002/156 X-Sequence-Number: 37577 Franck Routier writes: > I am wondering if deferring foreign key constraints (instead of > disableing them) would increase performance, compared to non deferred > constraints No, it wouldn't make any noticeable difference AFAICS. It would postpone the work from end-of-statement to end-of-transaction, but not make the work happen any more (or less) efficiently. regards, tom lane