Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vDGZQ-00693y-16 for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Oct 2025 06:19:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1vDGZN-006X3m-VZ for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Oct 2025 06:19:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vDGZN-006X3d-5g for pgsql-hackers@lists.postgresql.org; Mon, 27 Oct 2025 06:19:04 +0000 Received: from fhigh-a5-smtp.messagingengine.com ([103.168.172.156]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vDGZJ-004Qco-0c for pgsql-hackers@postgresql.org; Mon, 27 Oct 2025 06:19:03 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 3239214002A5 for ; Mon, 27 Oct 2025 02:18:58 -0400 (EDT) Received: from phl-imap-03 ([10.202.2.93]) by phl-compute-04.internal (MEProxy); Mon, 27 Oct 2025 02:18:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=compiler.org; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1761545938; x=1761632338; bh=SzgNYHATLnTsyvhBmBw/91c3l6NGacMdLlGTToiEox0=; b= A306mmuEBpNqheQFfvN7/mcVir4sLyYmcrxbu3p3gBb49jWD3pd1sBigiURvpReg 2+lNLa+8IqWlypXVKdGtT/uzJzv+kPEzVr8kmTCwIMFkK0HKBeuNnetRbk5SbV+L pnxq8WrZh8vR92eMNUwjI3uGFF2+8DqThYR3PjV6Z8AbWV7GS2juiK1a+m6+GxfC q+OmDFhvskFMWbUhTOBTqCHr8ABFutaqx4kDZ6uPA3bXSmoEsZ1CFE9mMWeiDs06 LHSpg+Pja3/jyi0o6CtSdu5/bZ4YJwK8HT7pVD/p9jAX4u/h7TbNw5omaVi363gN oo3TCLeRKQ0hz7aWqpgesg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1761545938; x=1761632338; bh=S zgNYHATLnTsyvhBmBw/91c3l6NGacMdLlGTToiEox0=; b=HzHaujfSJVBciPpfg jeQet8NvwfXwi/feSDyo6Ya+hTyySBGQgEQ9wAlhUK78rL/J1aDO1nwAhri4OKzR QAmpcDOIrZu9qu+TRe/LOlwPc/MMD9/yntfXICuVbrGXyx2Ee2UcZtg2oW3HGsyj VlY29CRQGRk1gxxNev9Gn/DIdqkm5zJbk0JKk/kYvRiIY2rWGNRHh7JG4gEKp3Yg xCLqDPEl3z12aEJacvXiKsC+4qnAAOn3HFkJ0L8TW7MbZh3qk80FVZvyHwFRoRjR l92SYQUogP3PP9YKHupZSnwARiz9WNtoh1mgSETwZcbsutNO4DQM61IUBHKxAxFp epibA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdduheejvdefucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefoggffhffvkfgjfhfutgfgsehtqhertd ertdejnecuhfhrohhmpedflfhovghlucflrggtohgsshhonhdfuceojhhovghlsegtohhm phhilhgvrhdrohhrgheqnecuggftrfgrthhtvghrnhepvdefleelteelveffkeeukeelje evudevfeelffduudetveeiffdttefhgefgueevnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomhepjhhovghlsegtohhmphhilhgvrhdrohhrghdpnh gspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepphhgshhq lhdqhhgrtghkvghrshesphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ic6394509:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 9905418E0069; Mon, 27 Oct 2025 02:18:57 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: AE1r89ybsZ1g Date: Mon, 27 Oct 2025 07:18:37 +0100 From: "Joel Jacobson" To: pgsql-hackers Message-Id: <4b7b49a5-5e1a-44a8-93e0-60457d15cb1d@app.fastmail.com> In-Reply-To: <66631FB7-5BEA-4ED5-A694-9AD8B9CCFEE8@gmail.com> References: <6899c044-4a82-49be-8117-e6f669765f7e@app.fastmail.com> <165530.1752362320@sss.pgh.pa.us> <02a7cd37-e2fc-4212-8b19-f8c239c95fb8@app.fastmail.com> <96f00bf1-cc9d-4520-9d02-9e14e7767c88@app.fastmail.com> <30c2aa7d-dd6c-4b68-a2e4-f217a1a34acf@app.fastmail.com> <0b4d402a-9ac2-4aa8-acf8-8231dbe579ea@app.fastmail.com> <3095599.1758644879@sss.pgh.pa.us> <0dc6a2cc-5216-4dc1-9dd2-430cafc6095b@app.fastmail.com> <52CC167F-763B-4ECA-B0B4-DAB381816828@gmail.com> <9186C6D0-F7A9-482A-9183-89E530B57E36@gmail.com> <1073593.1759423179@sss.pgh.pa.us> <4bd5e6c4-6fa7-44bb-869d-59a32a331fa8@app.fastmail.com> <85828f29-e72e-4400-94f3-9a69bc8dc239@app.fastmail.com> <2495353.1759860890@sss.pgh.pa.us> <8aeae418-92a6-4bbd-9c06-9574c79e59f7@app.fastmail.com> <2531672.1759868124@sss.pgh.pa.us> <474efa78-337c-41cd-a73a-f845a0115109@app.fastmail.com> <2749343.1759949176@sss.pgh.pa.us> <8bfca2be-1ec0-4e15-aafb-0b7b661fe936@app.fastmail.com> <9eba307f-f2fb-48f0-9507-2e197f39ef9e@app.fastmail.com> <8c71183a-0d28-4bcf-a806-78446ff95404@app.fastmail.com> <1009807.1760476747@sss.pgh.pa.us> <1F7227F5-C33D-4E2C-8511-33F1468590D0@gmail.com> <0a5a20d3-4621-46b3-b2ab-903f63a20dea@app.fastmail.com> <6F913129-ABEF-4004-AAF3-F22FC34!29AE8@gmail.com> <1547585.1760645808@sss.pgh.pa.us> <14865EB6-0BF4-462B-9072-10BDAC10C052@gmail.com> <0BCA1C2D-B92C-459E-B1A6-6D06BA4C62CF@gmail.com> <55d24cbb-e9ef-491f-a99b-b3dbd7cecdf9@app.fastmail.com> <38574cad-e90d-47b7-a015-753bb6bbc360@app.fastmail.com> <66631FB7-5BEA-4ED5-A694-9AD8B9CCFEE8@gmail.com> Subject: Re: Optimize LISTEN/NOTIFY Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Oct 27, 2025, at 02:27, Chao Li wrote: >> On Oct 27, 2025, at 07:24, Joel Jacobson wrote: >>=20 >> Write-up of changes since v20: >>=20 >> Two new fields have been added to QueueBackendStatus: >> + QueuePosition advisoryPos; /* safe skip-ahead position */ >> + bool advancingPos; /* backend is reading the queue */ ... > I did a quick review on v21 only focusing on the =E2=80=9Cdirect advan= cement=E2=80=9D logic. > > In v21, you added advisoryPos and advancingPos which is same as my=20 > proposed solution. But you missed an important point from mine. > ... > From this perspective, we need to add a new field=20 > adviancingTillPos to QueueBackendStatus. (This field was also missing=20 > from my proposed patch). I'm doubtful yet another field is worth the added complexity cost. Before increasing the complexity further, I think we should first try to simulate somewhat realistic workloads, to see if we actually have a problem first. /Joel