Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nU8Dj-0000Lj-JI for pgsql-general@arkaria.postgresql.org; Tue, 15 Mar 2022 14:32:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nU8Dh-00042V-Gk for pgsql-general@arkaria.postgresql.org; Tue, 15 Mar 2022 14:32:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nU8Dh-00042M-6i for pgsql-general@lists.postgresql.org; Tue, 15 Mar 2022 14:32:17 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nU8De-0006FO-7d for pgsql-general@postgresql.org; Tue, 15 Mar 2022 14:32:16 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 22FEW7Zs317666; Tue, 15 Mar 2022 10:32:08 -0400 From: Tom Lane To: =?UTF-8?B?0JDRgNGB0LXQvSDQkNGA0YPRgtGO0L3Rj9C9?= cc: =?UTF-8?B?cGdzcWwtZ2VuZXJhbA==?= Subject: Re: =?UTF-8?B?UmVbMl06IExJU1RFTi9OT1RJRlkgdWx0cmEgc2xvdyBzcGVlZA==?= In-reply-to: <1647340764.254194077@f561.i.mail.ru> References: <1647262405.342456086@f759.i.mail.ru> <1647329663.754713354@f111.i.mail.ru> <1647340764.254194077@f561.i.mail.ru> Comments: In-reply-to =?UTF-8?B?0JDRgNGB0LXQvSDQkNGA0YPRgtGO0L3Rj9C9?= message dated "Tue, 15 Mar 2022 13:39:24 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <317664.1647354727.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 15 Mar 2022 10:32:07 -0400 Message-ID: <317665.1647354727@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =3D?UTF-8?B?0JDRgNGB0LXQvSDQkNGA0YPRgtGO0L3Rj9C9?=3D writes= : > i looked at the file "\src\backend\commands\async.c" > there is a check for duplicate messages Yup. > Is this slowdown related to this check? [ shrug... ] You've provided no evidence either for or against that possibility. It seems a little unlikely that you could have a lot of pending messages without also seeing data accumulating in pg_notify/, but on the other hand it's also hard to think of other places that time could be getting spent if the queue is always empty. Can you use perf(1) or some such tool to try to identify where the time is being spent? There's some advice about that here: https://wiki.postgresql.org/wiki/Profiling_with_perf > Is it possible to skip the check if I'm absolutely sure the message is u= nique? Not a good idea. You could upgrade to PG 13 or later, where that code has been improved. regards, tom lane