Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T0grP-000520-Pd for pgsql-performance@postgresql.org; Sun, 12 Aug 2012 22:42:15 +0000 Received: from mail-pb0-f46.google.com ([209.85.160.46]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T0grN-0006br-Am for pgsql-performance@postgresql.org; Sun, 12 Aug 2012 22:42:15 +0000 Received: by pbbrr13 with SMTP id rr13so6177078pbb.19 for ; Sun, 12 Aug 2012 15:42:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-type:x-mailer:content-transfer-encoding:mime-version :x-gm-message-state; bh=Gc53WjDjo0BqTdiIphjXwYYg6IdWU5oZ4iPSrhfevQU=; b=NzqRRJIiwh8WCK42fiQ5E3FvEALEFfHEJKBlpq7W+cEx7Y9WJdBxpF7zQrhIvksiXg 99x8LHvifqQvztsDt1u3ZNVR2ySYS/6ebNgJR8HBDCFrULla4kKcbAzJ9qbTlGHvYoKZ feHJ/FF+JyVK75iDgVOgFb45oMx62glGxpS8ApJbmdmGd5MVv6ScD394cYtc5run4ABn ptmcNNj67+L9D0BG2Zt95camCYaZQ3aFpX/o6OGJSpS8kHzjI2a3howxiR77Y+V0KSHA fdE9fjcB3um6/KzQIyBjfEzgIr9y1ZbNg/w+5PZmXI3ZkAL9p/DWSNrzlzxuSuiOqbzh 4E/w== Received: by 10.68.213.97 with SMTP id nr1mr11261078pbc.105.1344811330988; Sun, 12 Aug 2012 15:42:10 -0700 (PDT) Received: from [192.168.1.101] (c-69-181-249-16.hsd1.ca.comcast.net. [69.181.249.16]) by mx.google.com with ESMTPS id hs7sm625231pbc.44.2012.08.12.15.42.09 (version=SSLv3 cipher=OTHER); Sun, 12 Aug 2012 15:42:10 -0700 (PDT) Message-ID: <1344811330.19209.27.camel@jdavis> Subject: Re: Deferred constraints performance impact ? From: Jeff Davis To: mark Cc: pgsql-performance@postgresql.org Date: Sun, 12 Aug 2012 15:42:10 -0700 In-Reply-To: <01a701cd661f$3cc05770$b6410650$@com> References: <01a701cd661f$3cc05770$b6410650$@com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.2- Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-Gm-Message-State: ALoCoQm0eJC0LhDgjZ13uFpwkwuz8/tehrZWG4opT030mr93LpmvveKGoz1GkoFCnLwwVjPbsaVr X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201208/70 X-Sequence-Number: 47608 On Thu, 2012-07-19 at 20:27 -0600, mark wrote: > I understand a lot more may have to be tracked through a transaction and > there could be some impact from that. Similar to an after update trigger? Or > are the two not comparable in terms of impact from what is tracked and then > checked. They should be very comparable to AFTER triggers. It's actually a little better because there are optimizations to avoid queuing constraint checks if we know it will pass. I would recommend testing a few degenerate cases to see how big the impact is, and try to see if that is reasonable for your application. Regards, Jeff Davis