Re: Add connection active, idle time to pg_stat_activity

Поиск
Список
Период
Сортировка
От Kuntal Ghosh
Тема Re: Add connection active, idle time to pg_stat_activity
Дата
Msg-id CAGz5QCLxnOpcPdjz-P0N_e3oT7SP0rz+Z9VmXCzKNywMpmHpqQ@mail.gmail.com
обсуждение исходный текст
Ответ на Add connection active, idle time to pg_stat_activity  (Rafia Sabih <rafia.pghackers@gmail.com>)
Ответы Re: Add connection active, idle time to pg_stat_activity  (Julien Rouhaud <rjuju123@gmail.com>)
Re: Add connection active, idle time to pg_stat_activity  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Список pgsql-hackers
On Fri, Oct 22, 2021 at 1:53 PM Rafia Sabih <rafia.pghackers@gmail.com> wrote:
> To provide this information I was digging into how the statistics
> collector is working and found out there is already information like
> total time that a connection is active as well as idle computed in
> pgstat_report_activity[1]. Ideally, this would be the values we would
> like to see per process in pg_stat_activity.
It's definitely useful to know how much time a backend has spent for
query executions. Once you've this info, you can easily calculate the
idle time using this information: (now() - backend_start) -
active_time. But, I'm wondering why you need to distinguish between
idle and idle in transactions - what's the usage? Either the backend
is doing some work or it sits idle. Another useful information would
be when the last query execution was ended. From this information, you
can figure out whether a backend is idle for a long time since the
last execution and the execution time of the last query (query_end -
query_start).

You also need to update the documentation.

-- 
Thanks & Regards,
Kuntal Ghosh



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Rationalizing declarations of src/common/ variables
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Catching missing Datum conversions