Re: Add session statistics to pg_stat_database - Mailing list pgsql-hackers

From Ahsan Hadi
Subject Re: Add session statistics to pg_stat_database
Date
Msg-id CA+9bhC+pGpp9xezwk-maOWmOCNg-0xm5OnPSSMmb2S=n7fTwMA@mail.gmail.com
Whole thread Raw
In response to Add session statistics to pg_stat_database  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: Add session statistics to pg_stat_database  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-hackers

On Wed, Jul 8, 2020 at 4:17 PM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
Here is a patch that adds the following to pg_stat_database:
- number of connections

Is it expected behaviour to not count idle connections? The connection is included after it is aborted but not while it was idle.
 
- number of sessions that were not disconnected regularly
- total time spent in database sessions
- total time spent executing queries
- total idle in transaction time

This is useful to check if connection pooling is working.
It also helps to estimate the size of the connection pool
required to keep the database busy, which depends on the
percentage of the transaction time that is spent idling.

Yours,
Laurenz Albe


--
Highgo Software (Canada/China/Pakistan)
URL : http://www.highgo.ca
ADDR: 10318 WHALLEY BLVD, Surrey, BC
EMAIL: mailto: ahsan.hadi@highgo.ca

pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: Parallel copy
Next
From: Paul Förster
Date:
Subject: Re: Building 12.3 from source on Mac