Re: [BUGS] BUG #10123: Weird entries in pg_stat_activity - Mailing list pgsql-bugs

From Fujii Masao
Subject Re: [BUGS] BUG #10123: Weird entries in pg_stat_activity
Date
Msg-id d7a858f9-404f-4535-8160-3222e43cf8c5@oss.nttdata.com
Whole thread Raw
In response to Re: [BUGS] BUG #10123: Weird entries in pg_stat_activity  (Andres Freund <andres@anarazel.de>)
List pgsql-bugs

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.

Regards,

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




pgsql-bugs by date:

Previous
From: Alena Rybakina
Date:
Subject: Re: Performance Issue on Query 18 of TPC-H Benchmark
Next
From: Ba Jinsheng
Date:
Subject: Re: Performance Issue on Query 18 of TPC-H Benchmark