Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iP7zM-0008Id-Ki for pgsql-performance@arkaria.postgresql.org; Mon, 28 Oct 2019 16:35:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iP7zL-0006L7-0v for pgsql-performance@arkaria.postgresql.org; Mon, 28 Oct 2019 16:35:27 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1iP7zK-0006L0-Mp for pgsql-performance@lists.postgresql.org; Mon, 28 Oct 2019 16:35:26 +0000 Received: from mail.online.net ([62.210.16.11]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iP7zI-0005no-39 for pgsql-performance@lists.postgresql.org; Mon, 28 Oct 2019 16:35:26 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.online.net (Postfix) with ESMTP id E145FF2B94D1 for ; Mon, 28 Oct 2019 17:35:22 +0100 (CET) Received: from mail.online.net ([127.0.0.1]) by localhost (mail.online.net [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id NKPQGd2nQGRC for ; Mon, 28 Oct 2019 17:35:22 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.online.net (Postfix) with ESMTP id B923EF2B9979 for ; Mon, 28 Oct 2019 17:35:22 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.online.net B923EF2B9979 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scaleway.com; s=CFA38AAE-D493-11E9-9041-6F7FC87095BF; t=1572280522; bh=SBSjyRc3qsnS5pMnxEU0bCqZJ3ooReO9ED8bc/4CWy0=; h=To:From:Message-ID:Date:MIME-Version; b=hDFe04dRYOmoCjXtZnowrAI/ag4L1eTFgCupMPrbSJNjkcfnX2/nuVHvaEF9qcckk SXsbnM74No7jWQGTpY7L+io+/Vbw4XvkG6KC7Grn5ODSStzOlVhpDh7vzHwOhItIDJ UcVjCRU5O0XyjkjKJrivxmDOotFG+JN8XryglMfeHQhrqO+athBTONrV68yef2khBj pkuXYaU+ax28NAZ6FKvwjXkDaMX9tuw/ryJed/bj/6yfoJ/b9fmB2+Q+U9DlShSrRJ dxsznfCT0U16Ag3AxHVgFKHvpvTnm7ShIKF1k7ZT4HnBPj5o44JJ151Jdt6XTKzJKR fuVHd/m6zbjJQ== X-Virus-Scanned: amavisd-new at mail.online.net Received: from mail.online.net ([127.0.0.1]) by localhost (mail.online.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 9FJbvVuQ1-sc for ; Mon, 28 Oct 2019 17:35:22 +0100 (CET) Received: from MacBook-Pro-de-Greg.local (unknown [195.154.229.35]) by mail.online.net (Postfix) with ESMTPSA id A2B38F2B94D1 for ; Mon, 28 Oct 2019 17:35:22 +0100 (CET) Subject: Re: Notifications within triggers seem to compromise performance To: pgsql-performance@lists.postgresql.org References: <2b617759-5c59-de3c-1de0-bed20d9c0db1@scaleway.com> <15979.1572272524@sss.pgh.pa.us> <1c0c95b4-01c4-bbbf-0e6e-f5d530e63ba0@scaleway.com> <24269.1572279925@sss.pgh.pa.us> From: =?UTF-8?Q?Gr=c3=a9goire_de_Turckheim?= Message-ID: Date: Mon, 28 Oct 2019 17:35:22 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <24269.1572279925@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Le 28/10/2019 =C3=A0 17:25, Tom Lane a =C3=A9crit=C2=A0: > =3D?UTF-8?Q?Gr=3Dc3=3Da9goire_de_Turckheim?=3D writes: >> Le 28/10/2019 =C3=A0 15:22, Tom Lane a =C3=A9crit=C2=A0: >>> We made some performance improvements for NOTIFY just a couple months >>> ago, cf commits b10f40bf0, bb5ae8f6c, bca6e6435, 51004c717. It would >>> be interesting to know how much those changes helped your use-case. >> If my understanding of the problem is correct, there is no performance >> issue with the notification itself. >> The problem is the following: a system-wide lock is taken pre-commit, = so >> any other transaction with a NOTIFY will have to wait for other >> transactions to complete before it can leave its own pre-commit stage. > Right, but all commits are single-threaded at some granularity. > The big problem with NOTIFY is that it sits for a long time holding > that lock, if you have a lot of notify traffic. The commits I mentione= d > should improve that. > > Anyway, as I said, it would be good to find out whether the already > finished fixes are enough to solve your problem, before we debate > whether more needs to be done. Let's do it this way, I'll give it a try (might be long, this isn't=20 something we can easily upgrade) and get back to you. Thanks! --=20 Gr=C3=A9goire de Turckheim