Re: Significance of queries listed under server activity items

Поиск
Список
Период
Сортировка
От Dave Page
Тема Re: Significance of queries listed under server activity items
Дата
Msg-id CA+OCxoywjgaXaGu1p=DXacDX2iCAYyOt-nEJ7qUOiaJ6X4x6MA@mail.gmail.com
обсуждение исходный текст
Ответ на Significance of queries listed under server activity items  (Adam Manwaring <pantsmann@byu.net>)
Список pgadmin-support
Hi

On Wed, Oct 18, 2017 at 6:25 PM, Adam Manwaring <pantsmann@byu.net> wrote:
When viewing the details on a row on the "Server Activity" table an sql query is listed along with a few timestamps. I've been assuming that the query shown is the last active query for that session. What I don't know is whether it is the last one committed or the last one begun. I've had some trouble with sessions stuck in "idle in transaction" status. I need to know if the query is the query that has not been committed or if it is the previous query (committed prior to one that is stuck). 

I can't seem to find anything that says specifically what this query is, so I don't know whether I should be looking at the query shown to figure out what is going wrong or if I need to look elsewhere. 

The data shown there almost all comes from the pg_stat_activity view. In PG 10, the query field is described as:

Text of this backend's most recent query. If state is active this field shows the currently executing query. In all other states, it shows the last query that was executed. By default the query text is truncated at 1024 characters; this value can be changed via the parameter track_activity_query_size. 

https://www.postgresql.org/docs/10/static/monitoring-stats.html#monitoring-stats-dynamic-views-table

In earlier versions, iirc the size wasn't limited.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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

Предыдущее
От: Adam Manwaring
Дата:
Сообщение: Significance of queries listed under server activity items
Следующее
От: Rob Emery
Дата:
Сообщение: PGAgent Connection Pool Leaking