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