Re: Patch: Show queries of processes holding a lock

From: Alexey Orlov <aporlov(at)gmail(dot)com>
To: wenhui qiu <qiuwenhuifx(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Patch: Show queries of processes holding a lock
Date: 2024-10-02 09:43:03
Message-ID: CALjmG4LLL4qTje9N7HQwLniRAuOOxSPqikspC7XrXuPRUnYCMg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 1, 2024 at 11:45 AM wenhui qiu <qiuwenhuifx(at)gmail(dot)com> wrote:
>
> Hi Alexey Orlov
> Thank you for your work on this path,The lock information is recorded in detail,Easy to trace the lock competition at that time there is a detailed lock competition log,But I have a concern,Frequent calls to this function (pgstat_get_backend_current_activity) in heavy lock contention or high concurrency environments may cause performance degradation, especially when processes frequently enter and exit lock waits. Can you add a guc parameter to turn this feature on or off?After all communities for this parameter( log_lock_waits )default values set to on many people concern (https://commitfest.postgresql.org/49/4718/)
>
>
>
> Thanks
>
Yeah, agree, thank you. I just think changing the parameter type would
be nice too.

typedef enum
{
LOG_LOCK_WAIT_NONE = 0,
LOG_LOCK_WAIT_TERSE,
LOG_LOCK_WAIT_VERBOSE,
} LogLockWaitVerbosity;

LOG_LOCK_WAIT_NONE is "off", LOG_LOCK_WAIT_TERSE is "on",
LOG_LOCK_WAIT_VERBOSE enables writing the query to to the log.

I've attached a slightly modified patch to use the new log_lock_wait values.

--
Regards,
Alexey Orlov!

Attachment Content-Type Size
v-2-0001-Show-queries-in-log_lock_wait.patch text/x-patch 5.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Jones 2024-10-02 09:47:42 Re: Psql meta-command conninfo+
Previous Message Fujii Masao 2024-10-02 09:40:08 Re: [BUG FIX]Connection fails with whitespace after keepalives parameter value