Equivalent of Oracle's per-session statistics (v$client_stats)?

From: Frits Jalvingh <jal(at)etc(dot)to>
To: pgsql-general(at)postgresql(dot)org
Subject: Equivalent of Oracle's per-session statistics (v$client_stats)?
Date: 2016-03-22 17:14:40
Message-ID: CAKhTGFWGO-+iw1ccKaZ7HyEs7J6bNuMsWJHMuj079OUhpauFbA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello list,

Oracle has a way to get per-session statistics. You identify a session
using a call to dbms_session.set_identifier('xxx'), then you enable
statistics using dbms_monitor.client_id_stat_enable('xxx').
After this you do normal database statements.
Before you close the connection you can read a view, v$client_stats, which
now contains all kinds of metrics specifically to your connection's use.
Metrics that can be read are things like the number of logical blocks read,
physical blocks read etc.
Using this mechanism you can show exactly how "bad" for instance a screen
from an application behaves, by finding out how much database I/O it does.

I was wondering whether Postgresql has something like this? I looked at the
pg_stats tables but I do not see anything that can be related to the
"current session" or "current connection".

Thanks for your time.

Regards,

Frits

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Magnus Hagander 2016-03-22 17:20:45 Re: Equivalent of Oracle's per-session statistics (v$client_stats)?
Previous Message Bruce Momjian 2016-03-22 16:58:37 Re: PostgreSQL advocacy