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

From Tom Lane
Subject Re: Optimize LISTEN/NOTIFY
Date
Msg-id 2749343.1759949176@sss.pgh.pa.us
Whole thread Raw
In response to Re: Optimize LISTEN/NOTIFY  ("Joel Jacobson" <joel@compiler.org>)
List pgsql-hackers
"Joel Jacobson" <joel@compiler.org> writes:
> On Tue, Oct 7, 2025, at 22:15, Tom Lane wrote:
>> 5. ChannelHashAddListener: "already registered" case is not reached,
>> which surprises me a bit, and neither is the "grow the array" stanza.

> I've added a test for the "grow the array" stanza.

> The "already registered" case seems impossible to reach, since the
> caller, Exec_ListenCommit, returns early if IsListeningOn.

Maybe we should remove the check for "already registered" then,
or reduce it to an Assert?  Seems pointless to check twice.

Or thinking a little bigger: why are we maintaining the set of
channels-listened-to both as a list and a hash?  Could we remove
the list form?

            regards, tom lane



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Invalid pointer access in logical decoding after error
Next
From: Greg Burd
Date:
Subject: Re: [PATCH] Add tests for Bitmapset