Re: Meaning of query age in pg_stat_activity - Mailing list pgsql-general

From Nikolay Samokhvalov
Subject Re: Meaning of query age in pg_stat_activity
Date
Msg-id CANNMO+LUSDTjpKwVLC0PXDO+wn++ZHPbtQG4c2yfyhxhhRqifw@mail.gmail.com
Whole thread Raw
In response to Re: Meaning of query age in pg_stat_activity  (Jan De Moerloose <jan@sensolus.com>)
Responses Re: Meaning of query age in pg_stat_activity
List pgsql-general
On Mon, Jan 29, 2018 at 3:19 PM, Jan De Moerloose <jan@sensolus.com> wrote:
The state is 'idle in transaction'.

So you have long-running *transactions*, not queries. This is not good for an OLTP system, because some transaction can wait of others, which are "idle in transaction" but do nothing at the moment. Think how you can make them shorter, commit faster.

Also, if your server version is 9.6+ consider setting idle_in_transaction_session_timeout to some low value:

pgsql-general by date:

Previous
From: Jan De Moerloose
Date:
Subject: Re: Meaning of query age in pg_stat_activity
Next
From: Jan De Moerloose
Date:
Subject: Re: Meaning of query age in pg_stat_activity