Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aRbyN-0006xm-5w for pgsql-performance@arkaria.postgresql.org; Fri, 05 Feb 2016 08:42:35 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aRbyM-0001g3-Gl for pgsql-performance@arkaria.postgresql.org; Fri, 05 Feb 2016 08:42:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aRbwj-0008AS-Em for pgsql-performance@postgresql.org; Fri, 05 Feb 2016 08:40:53 +0000 Received: from plane.gmane.org ([80.91.229.3]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aRbwh-0007DP-K4 for pgsql-performance@postgresql.org; Fri, 05 Feb 2016 08:40:52 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aRbwf-0003P6-OQ for pgsql-performance@postgresql.org; Fri, 05 Feb 2016 09:40:49 +0100 Received: from static.230.116.9.176.clients.your-server.de ([176.9.116.230]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 05 Feb 2016 09:40:49 +0100 Received: from hari.fuchs by static.230.116.9.176.clients.your-server.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 05 Feb 2016 09:40:49 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-performance@postgresql.org From: Harald Fuchs Subject: Re: bad COPY performance with NOTIFY in a trigger Date: Fri, 05 Feb 2016 09:40:44 +0100 Lines: 12 Message-ID: <87fux77do3.fsf@hf.protecting.net> References: <5721.1454625673@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: static.230.116.9.176.clients.your-server.de X-Archive: encrypt X-PGP-Fingerprint: 09 4E C4 A2 B2 C5 33 1A 79 80 5D 39 BD 9B 89 39 X-Face: (1awP+uzUZkz*UdAvr%F%K`x9g3n,CWkrK[r6TS,kY~DP)$C&=IJQ; H0uPn0B$Rb>\w"Tk~9w'; 1@dNIad{z!y(R99X7d-uc~Vf%,i.:=~=V>.b_)hr36Jt.tF0OBe]&PB6F.(k[i^^v^8DBny^)@17gud{[!1jfZ8+ User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:xACCKwqArvoAdRMWn/pgdaLWMwg= X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Tom Lane writes: > No surprise, see AsyncExistsPendingNotify. You would have a lot of other > performance issues with sending hundreds of thousands of distinct notify > events from one transaction anyway, so I can't get terribly excited about > this. @Filip: you probably want a per-statement trigger rather than a per-row trigger: insert all rows with COPY, then send one notification. You have to mark the new rows somehow yourself; unfortunately PostgreSQL has no way to tell them in a statement trigger. -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance