From: Artur Zając <azajac@ang.com.pl>
To: pgsql-performance@postgresql.org
Subject: NOTIFY performance
Date: Fri, 24 Aug 2012 20:46:42 +0200
Message-ID: <002401cd8228$ce80e970$6b82bc50$@ang.com.pl> (raw)
Hello,
I would like to create some application using triggers and LISTEN/NOTIFY
framework. I've tested it, and I noticed that performance of NOTIFY
significally decreases with increasing number of distinct NOTIFIES in
transaction.
I found that function AsyncExistsPendingNotify is responsibe for it. I think
that complexivity of searching duplicates there is O(N^2). Would be possible
to improve performance of it? Maybe by using list for elements precedence
and binary search tree for searching duplicates - with complexivity of
O(Nlog2(N)).
I'v tested with 50000 of NOTICES. Updating table with 20000 NOTICES when
searching is not performed took 1,5 second. With searching it took 28
seconds.
-------------------------------------------
Artur Zajac
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: azajac@ang.com.pl
Subject: Re: NOTIFY performance
In-Reply-To: <002401cd8228$ce80e970$6b82bc50$@ang.com.pl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox