Re: Listen / Notify rewrite

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Chernow <ac(at)esilo(dot)com>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Joachim Wieland <joe(at)mcknight(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Listen / Notify rewrite
Date: 2009-11-12 01:03:30
Message-ID: 9378.1257987810@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Chernow <ac(at)esilo(dot)com> writes:
> + * This function is executed for every notification found in the queue in order
> + * to check if the current backend is listening on that channel. Not sure if we
> + * should further optimize this, for example convert to a sorted array and
> + * allow binary search on it...

> I think a bsearch would be needed. Very busy servers that make heavy use of
> notifies would be quite a penalty.

Premature optimization is the root of all evil ;-). Unless you've done
some profiling and can show that this is a hot spot, making it more
complicated isn't the thing to be doing now.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Chernow 2009-11-12 01:03:54 Re: Listen / Notify rewrite
Previous Message Emmanuel Cecchet 2009-11-12 00:53:58 Re: Partitioning option for COPY