Add session statistics to pg_stat_database

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Add session statistics to pg_stat_database
Date: 2020-07-08 11:17:37
Message-ID: b07e1f9953701b90c66ed368656f2aef40cac4fb.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Here is a patch that adds the following to pg_stat_database:
- number of connections
- 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

Attachment Content-Type Size
0001-Add-session-statistics-to-pg_stat_database.patch text/x-patch 17.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message wenjing zeng 2020-07-08 11:24:52 Re: [bug] Table not have typarray when created by single user mode
Previous Message Alexander Korotkov 2020-07-08 11:00:31 Re: Quick doc patch