Re: NOTIFY channel - Mailing list pgsql-general

From Tom Lane
Subject Re: NOTIFY channel
Date
Msg-id 13911.1366995055@sss.pgh.pa.us
Whole thread Raw
In response to NOTIFY channel  (Perry Smith <pedzsan@gmail.com>)
List pgsql-general
Perry Smith <pedzsan@gmail.com> writes:
> I'm curious what the design assumptions of the LISTEN / NOTIFY are.  For example, would it work to have a thousand
LISTENchannels open at the same time or would that be abusing the assumptions that were made?  In short, I'm trying to
understandif I need a few central LISTEN / NOTIFY channels that then distribute the events out or not. 

In the current implementation (since 9.0 IIRC), I don't believe the
total number of channels in use affects the transport mechanism at all.
However, the number that a particular backend is listening on would
affect how fast it can process the messages --- we just run through the
local LISTEN-names list serially for a match to see if an incoming
message is interesting or not.  So I'd try to avoid having individual
sessions listening to very large numbers of channels.  OTOH, the serial
list scan might still be faster than anything you could easily do in SQL
or plpgsql to sort through messages you were trying to route manually.

            regards, tom lane


pgsql-general by date:

Previous
From: Rafał Pietrak
Date:
Subject: Re: is there a way to deliver an array over column from a query window?
Next
From: Tom Lane
Date:
Subject: Re: How to find current row number relative to window frame