Re: NOTIFY and pg_notify performance when deduplicating notifications - Mailing list pgsql-hackers

From Tom Lane
Subject Re: NOTIFY and pg_notify performance when deduplicating notifications
Date
Msg-id 16074.1547153778@sss.pgh.pa.us
Whole thread Raw
In response to Re: NOTIFY and pg_notify performance when deduplicating notifications  (Julien Demoor <julien@jdemoor.com>)
Responses Re: NOTIFY and pg_notify performance when deduplicating notifications  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Julien Demoor <julien@jdemoor.com> writes:
> [ postgres-notify-all-v8.patch ]

I took a quick look through this.  A few comments:

* I find the proposed syntax extension for NOTIFY to be fairly bizarre;
it's unlike the way that we handle options for any other utility
statement.  It's also non-orthogonal, since you can't specify a collapse
mode without giving a payload string.  I think possibly a better answer
is the way that we've been adding optional parameters to VACUUM and
suchlike recently:

     NOTIFY [ (collapse = off/on) ] channel [ , payload ]

This'd be more extensible if we ever find a need for other options,
too.

* I'm also unimpressed with the idea of having a "maybe" collapse mode.
What's that supposed to do?  It doesn't appear to be different from
"always", so why not just reduce this to a boolean collapse-or-not
flag?

* The documentation doesn't agree with the code, since it fails to
mention "always" mode.

* I was kind of disappointed to find that the patch doesn't really
do anything to fix the performance problem for duplicate notifies.
The thread title had led me to hope for more ;-).  I wonder if we
couldn't do something involving hashing.  OTOH, it's certainly
arguable that that would be an independent patch, and that this
one should be seen as a feature patch ("make NOTIFY's behavior
for duplicate notifies more flexible and more clearly specified")
rather than a performance patch.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: add_partial_path() may remove dominated path but still in use
Next
From: Fabien COELHO
Date:
Subject: Re: [HACKERS] pgbench - allow to store select results intovariables