Re: Optimize LISTEN/NOTIFY

From: "Joel Jacobson" <joel(at)compiler(dot)org>
To: "Arseniy Mukhin" <arseniy(dot)mukhin(dot)dev(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Optimize LISTEN/NOTIFY
Date: 2025-11-13 07:13:28
Message-ID: a0215c3a-ffd0-41f1-900c-ddc74e1ffd6d@app.fastmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 13, 2025, at 07:36, Arseniy Mukhin wrote:
> On Thu, Nov 13, 2025 at 9:28 AM Joel Jacobson <joel(at)compiler(dot)org> wrote:
>> I think this confirms that listeners can actually stop somewhere in between
>> queueHeadBeforeWrite and queueHeadAfterWrite.
>
>
> Ahh, yes, I think you are right. I missed that notifiers update the
> head when they move to the next page. Thank you for the detailed
> example and sorry for taking your time with it. I agree that
> QUEUE_POS_PRECEDES(pos, queueHeadAfterWrite) is correct and covers
> more cases where we can do direct advancement.

Thanks for investigating this; we now both have an even stronger mental
model of the code.

Attached, please find a new version rebased on top of the bug fix
patches that just got committed in 0bdc777, 797e9ea, 8eeb4a0, and
1b46990.

/Joel

Attachment Content-Type Size
0001-optimize_listen_notify-v27.patch application/octet-stream 9.3 KB
0002-optimize_listen_notify-v27.patch application/octet-stream 43.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Corey Huinker 2025-11-13 07:32:17 Re: Extended Statistics set/restore/clear functions.
Previous Message Yugo Nagata 2025-11-13 07:09:29 Re: Suggestion to add --continue-client-on-abort option to pgbench