Re: relationship of backend_start, query_start, state_change

From: Olivier Gautherot <ogautherot(at)gautherot(dot)net>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Si Chen <sichen(at)opensourcestrategies(dot)com>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: relationship of backend_start, query_start, state_change
Date: 2020-04-23 16:58:36
Message-ID: CAJ7S9TXQyvq56wW4ttSHHKb+9wLmBAbr=r8WbFw9up-MmR5JHQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi David,

On Thu, Apr 23, 2020 at 6:55 PM David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> On Thu, Apr 23, 2020 at 9:37 AM Si Chen <sichen(at)opensourcestrategies(dot)com>
> wrote:
>
>> Hello,
>>
>> I'm looking at my pg_stat_activity and trying to figure out what is
>> causing some of these processes. I'm using this query:
>>
>> SELECT pid, wait_event, state_change, backend_start, xact_start,
>> query_start, state_change - query_start, query from pg_stat_activity where
>> datname= 'my_database' and state in ('idle', 'idle in transaction', 'idle
>> in transaction (aborted)', 'disabled');
>>
>>
> Including the "state" field should clear things up considerably.
>
>
> https://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW
>
>
> David J.
>

The transactions are idle, they are filtered in the WHERE statement.

--
Olivier Gautherot

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2020-04-23 17:00:59 Re: relationship of backend_start, query_start, state_change
Previous Message David G. Johnston 2020-04-23 16:55:06 Re: relationship of backend_start, query_start, state_change