Re: pg_stat_statements locking

From: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat_statements locking
Date: 2022-09-12 17:47:36
Message-ID: 97FA14BC-3B93-41EA-92E8-DD62F66B422D@yandex-team.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 12 Sep 2022, at 18:18, Julien Rouhaud <rjuju123(at)gmail(dot)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 implement this.

Best regards, Andrey Borodin.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-09-12 17:58:24 Re: Allow pageinspect's bt_page_stats function to return a set of rows instead of a single row
Previous Message Julien Rouhaud 2022-09-12 17:03:14 Re: Convert *GetDatum() and DatumGet*() macros to inline functions