Re: Listen / Notify rewrite - Mailing list pgsql-hackers

From Joachim Wieland
Subject Re: Listen / Notify rewrite
Date
Msg-id dc7b844e0911120221t67aaa719wa25ea2767bf2d5f8@mail.gmail.com
Whole thread Raw
In response to Re: Listen / Notify rewrite  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
List pgsql-hackers
On Thu, Nov 12, 2009 at 2:12 AM, Andrew Gierth
<andrew@tao11.riddles.org.uk> wrote:
> Does it cope with the case where a trigger is doing NOTIFY, and you do
> a whole-table update, therefore dumping potentially millions of
> notifications in at once?
>
> (for example a rare maintenance operation on a table which has a
> listen/notify arrangement triggered by single inserts or updates)
>
> The existing implementation copes with that just fine.

As long as you use the existing way to send out notifications by just
sending "NOTIFY foo", then yes, it will cope with millions of them
just fine because it will collapse them into one notification as does
the current implementation (contrary to the current implementation a
notification will be received from every transaction that has sent one
- the current implementation even collapses notifications from
different transactions).

However if you decide to use the new syntax and add a distinct payload
to every NOTIFY, then you also send out millions of notifications...

With the proposed patch the queue has space for up to about 81,787,680
notifications. The limits are mainly imposed by slru.c which defines
page size, pages per segment and the number of segments available. We
could easily bump that up to a multiple of the current limits if we
have decided that we need to...


Joachim


pgsql-hackers by date:

Previous
From: Boszormenyi Zoltan
Date:
Subject: Re: CommitFest 2009-09, two weeks on
Next
From: Itagaki Takahiro
Date:
Subject: Re: Syntax for partitioning