Re: shared-memory based stats collector - v70

Поиск
Список
Период
Сортировка
От Drouvot, Bertrand
Тема Re: shared-memory based stats collector - v70
Дата
Msg-id e67b920f-d89d-9f13-28e4-f753c9aef9ae@amazon.com
обсуждение исходный текст
Ответ на Re: shared-memory based stats collector - v70  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Hi,

On 8/9/22 6:47 PM, Andres Freund wrote:
> Hi,
>
> On 2022-08-09 12:00:46 -0400, Greg Stark wrote:
>> I was more aiming at a C function that extensions could use directly
>> rather than an SQL function -- though I suppose having the former it
>> would be simple enough to implement the latter using it. (though it
>> would have to be one for each stat type I guess)
> I think such a C extension could exist today, without patching core code? It'd
> be a bit ugly to include pgstat_internal.h, I guess, but other than that...

Yeah, agree that writing such an extension is doable today.

>> The main problem with my current code is that I'm accessing the shared
>> memory hash table directly. This means the I'm possibly introducing
>> locking contention on the shared memory hash table.
> I don't think that's a large enough issue to worry about unless you're
> polling at a very high rate, which'd be a bad idea in itself. If a backend
> can't get the lock for some stats change it'll defer flushing the stats a bit,
> so it'll not cause a lot of other problems.

+1

Regards,

-- 
Bertrand Drouvot
Amazon Web Services: https://aws.amazon.com




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

Предыдущее
От: "Drouvot, Bertrand"
Дата:
Сообщение: Re: shared-memory based stats collector - v70
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: createuser doesn't tell default settings for some options