Re: Proposal: Out-of-Order NOTIFY via GUC to Improve LISTEN/NOTIFY Throughput

From: "Joel Jacobson" <joel(at)compiler(dot)org>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Rishu Bagga" <rishu(dot)postgres(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, "nik(at)postgres(dot)ai" <nik(at)postgres(dot)ai>
Subject: Re: Proposal: Out-of-Order NOTIFY via GUC to Improve LISTEN/NOTIFY Throughput
Date: 2025-07-18 09:59:24
Message-ID: c41342af-52d5-4eca-9b28-a7bdb62c58a4@app.fastmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 18, 2025, at 08:46, Joel Jacobson wrote:
> However, for cases when up to K backends listen on the same channel (multicast),
> my patch and benchmark in the other thread suggests we can achieve massive
> improvements of parallelization of both LISTEN/UNLISTEN as well as NOTIFY
> without introducing that much extra complexity.
>
> Do we find this goal worth pursuing on its own?
>
> Or should we only focus on exposing a new third parameter to pg_notify()
> to indicate out-of-order delivery?

I guess the best would be if we could do both, i.e. improve existing use-cases as well as out-of-order delivery per notification, within acceptable levels of increased complexity?

One thing I wonder though, that I haven't yet benchmarked, is if even more parallelization than what my in-order optimizations of NOTIFY already achives, would actually significantly improve parallelization of real workloads, where you do some actual DML in the same txn that you send a NOTIFY. My in-order optimizations now scale to 3000 tps at 1000 connections. I wonder if PostgreSQL really can push that much DML tps, or if the serialization effect of LISTEN/NOTIFY would be marginal to other serialization caused by the DML.

/Joel

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Sutou Kouhei 2025-07-18 10:05:53 Re: Make COPY format extendable: Extract COPY TO format implementations
Previous Message Sutou Kouhei 2025-07-18 09:49:12 Re: Make COPY format extendable: Extract COPY TO format implementations