Re: Add connection active, idle time to pg_stat_activity

From: Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Sergey Dudoladov <sergey(dot)dudoladov(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Aleksander Alekseev <aleksander(at)timescale(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, Andrei Zubkov <zubkov(at)moonset(dot)ru>
Subject: Re: Add connection active, idle time to pg_stat_activity
Date: 2026-02-16 18:13:57
Message-ID: CA+FpmFcOjbC1MdJFt--EL85pG4v2uXZkhjevPqogBNvZ5aQWbA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 10 Apr 2025 at 18:41, Richard Guo <guofenglinux(at)gmail(dot)com> wrote:

> On Fri, Apr 11, 2025 at 3:47 AM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> > I'd probably write the increments as ++ rather than += 1 but I'm not
> > sure if everyone would agree.
>
> I'm a fan of ++ as well, so I agree.
>
> Thanks
> Richard
>
>
> Looking at this patch and the idea altogether I have other thoughts on
this now.
Thinking about the original problem of having a count of total idle in
transaction time, seems unnecessary with the availability of state_change
timestamp along with state columns in pg_stat_activity.

--
Regards,
Rafia Sabih
CYBERTEC PostgreSQL International GmbH

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2026-02-16 18:15:28 Re: Speed up COPY FROM text/CSV parsing using SIMD
Previous Message Tom Lane 2026-02-16 18:08:23 Re: generating function default settings from pg_proc.dat