Re: [BUGS] BUG #10123: Weird entries in pg_stat_activity

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, maxim(dot)boguk(at)gmail(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: [BUGS] BUG #10123: Weird entries in pg_stat_activity
Date: 2024-10-17 04:19:52
Message-ID: b5c6f74d-302a-41a9-8b9f-7b5ceb230d4a@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2024/10/17 1:59, Fujii Masao wrote:
>
>
> On 2024/07/05 7:03, Andres Freund wrote:
>> Calls to pgstat_report_activity() aren't exactly free. This substantially
>> increases the number of calls to it for common workloads. There got to be a
>> more targeted way of dealing with this.
>
> Yes. So, as an alternative approach, how about setting xact_start and
> query_start to NULL whenever the state is idle, since non-NULL values
> aren't expected in that case? This would prevent the weired pg_stat_activity
> entries I mentioned earlier, with minimal performance impact.

Patch attached.

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

Attachment Content-Type Size
v2-0001-Prevent-misleading-entries-in-pg_stat_activity.patch text/plain 3.2 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrew Bille 2024-10-17 05:47:00 Re: BUG #18658: Assert in SerialAdd() due to race condition
Previous Message Tender Wang 2024-10-17 04:18:55 Re: BUG #18657: Using JSON_OBJECTAGG with volatile function leads to segfault