Re: listen/notify argument (old topic revisited)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: listen/notify argument (old topic revisited)
Дата
Msg-id 24552.1025706649@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: listen/notify argument (old topic revisited)  (Hannu Krosing <hannu@tm.ee>)
Ответы Re: listen/notify argument (old topic revisited)  (Hannu Krosing <hannu@tm.ee>)
Re: listen/notify argument (old topic revisited)  (Hannu Krosing <hannu@tm.ee>)
Список pgsql-hackers
Hannu Krosing <hannu@tm.ee> writes:
> There could a little more smartness here to avoid unneccessary copying
> (not just storing) of not-listened-to data.

Yeah, I was wondering about that too.

> I guess that depending on the circumstances this can be either faster or
> slower than copying them all in one memmove.

The more interesting question is whether it's better to hold the read
lock on the shared buffer for the minimum possible amount of time; if
so, we'd be better off to pull the data from the buffer as quickly as
possible and then sort it later.  Determining whether we are interested
in a particular notify name will probably take a probe into a (local)
hashtable, so it won't be super-quick.  However, I think we could
arrange for readers to use a sharable lock on the buffer, so having them
expend that processing while holding the read lock might be acceptable.

My guess is that the actual volume of data going through the notify
mechanism isn't going to be all that large, and so avoiding one memcpy
step for it isn't going to be all that exciting.  I think I'd lean
towards minimizing the time spent holding the shared lock, instead.
But it's a judgment call.
        regards, tom lane




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: listen/notify argument (old topic revisited)
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: (A) native Windows port