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

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: Equivalent of Oracle's per-session statistics (v$client_stats)?
Дата
Msg-id CABUevEycSGvb5MYaBR_a+P+FWy9Uy0UBbzn3NKJr_Q2i6U6_sw@mail.gmail.com
обсуждение исходный текст
Ответ на Equivalent of Oracle's per-session statistics (v$client_stats)?  (Frits Jalvingh <jal@etc.to>)
Список pgsql-general


On Mar 22, 2016 6:14 PM, "Frits Jalvingh" <jal@etc.to> wrote:
>
> 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".
>

There aren't really any on a session basis but there are per transaction. Take a look at pg_stat_xact_*.

/Magnus

В списке pgsql-general по дате отправления:

Предыдущее
От: Frits Jalvingh
Дата:
Сообщение: Equivalent of Oracle's per-session statistics (v$client_stats)?
Следующее
От: CS DBA
Дата:
Сообщение: Partitioning and ORM tools