Re: pg_stat_statements locking - Mailing list pgsql-hackers

From Andrey Borodin
Subject Re: pg_stat_statements locking
Date
Msg-id 97FA14BC-3B93-41EA-92E8-DD62F66B422D@yandex-team.ru
Whole thread Raw
In response to Re: pg_stat_statements locking  (Julien Rouhaud <rjuju123@gmail.com>)
Responses Re: pg_stat_statements locking
List pgsql-hackers

> On 12 Sep 2022, at 18:18, Julien Rouhaud <rjuju123@gmail.com> wrote:
>
> That being
> said I don't know if adding a timeout would be too expensive for the lwlock
> infrastructure.

Implementation itself is straightforward, but we need to add 3 impls of waiting for semaphore with timeout.
POSIX have sem_timedwait(). Windows' WaitForMultipleObjectsEx() have timeout arg. SysV have semtimedop().
That's what we need to add something like LWLockAcquireWithTimeout().

Does adding all these stuff sound like a good tradeoff for lock-safe pg_stat_statements? If so - I'll start to
implementthis. 

Best regards, Andrey Borodin.


pgsql-hackers by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: Convert *GetDatum() and DatumGet*() macros to inline functions
Next
From: Tom Lane
Date:
Subject: Re: Allow pageinspect's bt_page_stats function to return a set of rows instead of a single row