Re: Optimize LISTEN/NOTIFY

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Joel Jacobson <joel(at)compiler(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Optimize LISTEN/NOTIFY
Date: 2025-10-28 01:02:57
Message-ID: 82DEA2B6-6FC5-4A79-BDE3-1FD72F104A6E@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Oct 27, 2025, at 14:18, Joel Jacobson <joel(at)compiler(dot)org> wrote:
>
> On Mon, Oct 27, 2025, at 02:27, Chao Li wrote:
>>> On Oct 27, 2025, at 07:24, Joel Jacobson <joel(at)compiler(dot)org> wrote:
>>>
>>> Write-up of changes since v20:
>>>
>>> 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 “direct advancement” logic.
>>
>> In v21, you added advisoryPos and advancingPos which is same as my
>> proposed solution. But you missed an important point from mine.
>>
> ...
>> From this perspective, we need to add a new field
>> adviancingTillPos to QueueBackendStatus. (This field was also missing
>> 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
>

I don’t think that’s extra complexity, IMO, that just ensure “direct advancement” to be fully functional.

But anyway, we should run some load tests to verify every solution to see how much they really improve. Do you already have or plan to work on a load test script?

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2025-10-28 01:08:36 Re: Feature: psql - display current search_path in prompt
Previous Message Chao Li 2025-10-28 00:57:36 Re: [PATCH] pg_bsd_indent: improve formatting of multiline comments