Re: Optimize LISTEN/NOTIFY - Mailing list pgsql-hackers

From Joel Jacobson
Subject Re: Optimize LISTEN/NOTIFY
Date
Msg-id 6e538502-81c8-453b-ba6d-be2a5ce85e9e@app.fastmail.com
Whole thread Raw
In response to Re: Optimize LISTEN/NOTIFY  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, Nov 25, 2025, at 21:17, Tom Lane wrote:
> "Joel Jacobson" <joel@compiler.org> writes:
>> It looks to me like it would be best with two boolean fields; one
>> boolean to stage the updates during PreCommit_Notify, that each
>> pendingActions could flip back and forth, and another boolean that
>> represents the current value, which we would overwrite with the staged
>> value during AtCommit_Notify.
>
> +1, I had a feeling that a single boolean wouldn't quite do it.
> (There are various ways we could define the states, but what
> you say above seems pretty reasonable.)

I've implemented the two boolean approach and think it's good.

The signals arrays are now preallocated during PreCommit_Notify.

More details in the patch message under "Two-phase staging pattern".

/Joel
Attachment

pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: NLS: use gettext() to translate system error messages
Next
From: Jeff Davis
Date:
Subject: Re: [18] CREATE SUBSCRIPTION ... SERVER