Re: Meaning of query age in pg_stat_activity

From: Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>
To: Jan De Moerloose <jan(at)sensolus(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Meaning of query age in pg_stat_activity
Date: 2018-01-29 23:29:49
Message-ID: CANNMO+LUSDTjpKwVLC0PXDO+wn++ZHPbtQG4c2yfyhxhhRqifw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Jan 29, 2018 at 3:19 PM, Jan De Moerloose <jan(at)sensolus(dot)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:
https://www.postgresql.org/docs/current/static/runtime-config-client.html#GUC-IDLE-IN-TRANSACTION-SESSION-TIMEOUT

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jan De Moerloose 2018-01-29 23:45:45 Re: Meaning of query age in pg_stat_activity
Previous Message Jan De Moerloose 2018-01-29 23:19:55 Re: Meaning of query age in pg_stat_activity