How to identify long-running queries, not just long-running backends?

Поиск
Список
Период
Сортировка
От Jeff Boes
Тема How to identify long-running queries, not just long-running backends?
Дата
Msg-id d2h57f$2451$1@news.hub.org
обсуждение исходный текст
Ответы Re: How to identify long-running queries, not just long-running backends?  (Jeff Boes <jboes@nexcerpt.com>)
Список pgsql-general
I need a way to identify Pg backends which have been running a given
query for a long time. What I have so far is to use pg_stat_activity and
the process table (in my case, via Perl's Proc::ProcessTable) to
identify processes with a lot of CPU usage and an active query. The
problem is false positives: since we use a daemon architecture which may
keep a Pg backend open for a while and run many, many queries, I can't
tell the difference between a backend which has run one query with
elapsed time of several minutes, and a backend which has run 1000
queries each with a sub-second elapsed time.

What I'm really hoping for is a way to get the "start time" for a query
in pg_stat_activity.

I'm using 7.4.1, by the way.

--
Jeff Boes                                         Vox 269-226-9550 x24
Director of Software Development                  Fax 269-349-9076

Exfacto!         Exceptional Online Content     http://www.exfacto.com
Nexcerpt         ...Extend Your Expertise...    http://www.nexcerpt.com

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: truncate/create slowness
Следующее
От: Jeff Boes
Дата:
Сообщение: Re: How to identify long-running queries, not just long-running backends?