Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id B9A94632820 for ; Sun, 14 Feb 2010 07:21:12 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 41198-08 for ; Sun, 14 Feb 2010 11:21:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by mail.postgresql.org (Postfix) with ESMTP id 542C563256F for ; Sun, 14 Feb 2010 07:21:01 -0400 (AST) Received: by ey-out-2122.google.com with SMTP id 25so380849eya.33 for ; Sun, 14 Feb 2010 03:20:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:cc:content-type; bh=Niil6Nc6FRTX0tF/PSEopfmOdPq65rcqelMHuuXudD0=; b=qShbxCRch6N+nJzh3AjzGRyZ8hycdRMHPELx2H2s4hLzyWBGJSLnMvMJmdxyZ2SBBe E73JLdyPw5KfpGUmwf6m4s3Y0dSpirBRu5jTwTP4YfbH/C/MqCsQgAFV/ReKeEwWkqWj yVp7Tkg0YoY9VFe5fRabwDsSHXeQloyJB12GE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; b=nGaCP6ZZLq67PQE8Zjvs0A4l7Kvd4fkpRxbmBjJsjUdhgxaRCmJ1PfBeNj18cBADmV Vww1Vxngj6jcvtIlw8UF6h+9uXL4IHKlVJP26ciVCK5xsbCv9qI7Uf63jmEWirXrqpEf 4Oiu2nOufWA8QOkcVQXnJlD/h1mX3sm9BhFKw= MIME-Version: 1.0 Received: by 10.213.100.231 with SMTP id z39mr1929896ebn.39.1266140714378; Sun, 14 Feb 2010 01:45:14 -0800 (PST) In-Reply-To: <16009.1265813800@sss.pgh.pa.us> References: <1265799331.28404.14.camel@franck-laptop> <16009.1265813800@sss.pgh.pa.us> Date: Sun, 14 Feb 2010 11:45:14 +0200 Message-ID: <331e40661002140145l610042d8pc27c61e6c23463df@mail.gmail.com> Subject: Re: Deferred constraint and delete performance From: =?KOI8-U?B?96bUwcymyiD0yc3eydvJzg==?= Cc: pgsql-performance@postgresql.org Content-Type: multipart/alternative; boundary=001636c5b90f84255d047f8c5b2d X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.306 tagged_above=-10 required=5 tests=BAYES_00=-2.599, HTML_MESSAGE=0.001, MISSING_HEADERS=1.292 X-Spam-Level: X-Archive-Number: 201002/224 X-Sequence-Number: 37645 --001636c5b90f84255d047f8c5b2d Content-Type: text/plain; charset=ISO-8859-1 2010/2/10 Tom Lane > 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. > > What about disc access? Won't "working" with one table, then another be faster than working with both at the same time? --001636c5b90f84255d047f8c5b2d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

2010/2/10 Tom Lane <= ;tgl@sss.pgh.pa.us>
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex;">
Franck Routier <franck.routier@axege.com> writes:
> I am wondering if deferring foreign key constraints (instead of
> disableing them) would increase performance, compared to non deferred<= br> > constraints

No, it wouldn't make any noticeable difference AFAICS. =A0It woul= d
postpone the work from end-of-statement to end-of-transaction,
but not make the work happen any more (or less) efficiently.

What about disc access? Won't "working"= with one table, then another be faster than working with both at the same = time?
--001636c5b90f84255d047f8c5b2d--