Re: proposal: make NOTIFY list de-duplication optional

From: Filip Rembiałkowski <filip(dot)rembialkowski(at)gmail(dot)com>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: Vik Fearing <vik(at)2ndquadrant(dot)fr>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: make NOTIFY list de-duplication optional
Date: 2016-02-08 20:33:43
Message-ID: CAP_rwwkG5pkGLAXz4h9ax7Qy2oyJNyjJfw6iQyTJvdPTC0TSAA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Feb 8, 2016 at 1:52 PM, Craig Ringer <craig(at)2ndquadrant(dot)com> wrote:

> Would it be correct to say that if ALL is specified then a message is queued
> no matter what. If DISTINCT is specified then it is only queued if no
> message with the same channel and argument is already queued for delivery.
Yes, exactly.

> Using DISTINCT can never decrease the total number of messages to be sent.
This sentence does not sound true. DISTINCT is the default, old
behaviour. It *can* decrease total number of messages (by
deduplication)

> I've found the deduplication functionality of NOTIFY very frustrating in the past
> and I see this as a significant improvement. Sometimes the *number of times*
> something happened is significant too...
yep, same idea here.

Here is my next try, after suggestions from -perf and -hackers list:

* no GUC

* small addition to NOTIFY grammar: NOTIFY ALL/DISTINCT

* corresponding, 3-argument version of pg_notify(text,text,bool)

* updated the docs to include new syntax and clarify behavior

* no hashtable in AsyncExistsPendingNotify
(I don't see much sense in that part; and it can be well done
separately from this)

Attachment Content-Type Size
postgres-notify-all-v2.patch text/x-patch 9.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2016-02-08 20:36:17 Re: [ADMIN] 9.5 new setting "cluster name" and logging
Previous Message Tom Lane 2016-02-08 20:26:19 Re: count_nulls(VARIADIC "any")