Re: NOTIFY channel

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: NOTIFY channel
Дата
Msg-id 13911.1366995055@sss.pgh.pa.us
обсуждение исходный текст
Ответ на NOTIFY channel  (Perry Smith <pedzsan@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Rafał Pietrak
Дата:
Сообщение: Re: is there a way to deliver an array over column from a query window?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: How to find current row number relative to window frame