Meaning of query age in pg_stat_activity

Поиск
Список
Период
Сортировка
От Jan De Moerloose
Тема Meaning of query age in pg_stat_activity
Дата
Msg-id CAF06xsTLGXpYKfP3RtWW_-VP0RE28+V6mv8fJHXB6y1xFzsgoA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Meaning of query age in pg_stat_activity  (Nikolay Samokhvalov <samokhvalov@gmail.com>)
Re: Meaning of query age in pg_stat_activity  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
Hi,

I'm using the following to detect long running queries in a webapp that is high on cpu:

SELECT pid, age(clock_timestamp(),query_start) as age, usename, query, state from pg_stat_activity order by age;

When the cpu is 100% and the app slowing down, i can see that some queries have a long age.
Running the same queries in psql is very fast, however. The db itself is low on cpu.

Is the age value as i calculate it representing the time spent by the database to execute the query or does it also include the time to read the result ? In other words, if the client is starving on cpu, will i see higher values of age ?

Regards,
Jan

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

Предыдущее
От: Tatsuo Ishii
Дата:
Сообщение: Re: pgpool Connections Distributions Among Nodes
Следующее
От: Nikolay Samokhvalov
Дата:
Сообщение: Re: Meaning of query age in pg_stat_activity