Re: notify duplicate elimination performance - Mailing list pgsql-hackers

From Andres Freund
Subject Re: notify duplicate elimination performance
Date
Msg-id 20140208180209.GB10692@awork2.anarazel.de
Whole thread Raw
In response to notify duplicate elimination performance  (Hardy Falk <hardy.falk@blue-cable.de>)
Responses Re: notify duplicate elimination performance  (Hardy Falk <hardy.falk@blue-cable.de>)
List pgsql-hackers
Hi,

On 2014-02-08 18:56:41 +0100, Hardy Falk wrote:
> I know that it is not a big problem for most users, but allowing a very
> large number of notifications while using linear search is a bit dumb.
> I can fix this with a very small modification to
> struct Notification:
> {
>     char *channel ;
>     char *payload ;
>     uint32 hash ;
>     struct Notification *left ;
>     struct Notification *right ;
> }
> AsyncExistsPendingNotify does an iterative binary tree search.
> The tree is insert-only, there is no need for rebalancing, and the code
> is quite simple.
> Any comments?

Well, you didn't add any code, so it's hard to say... Simple ways of
doing what I think you describe will remove the queue's order. Do you
preserve the ordering guarantees?

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Hardy Falk
Date:
Subject: notify duplicate elimination performance
Next
From: Hardy Falk
Date:
Subject: Re: notify duplicate elimination performance