官术网_书友最值得收藏!

Finding more detailed information in pg_stat_activity

The pg_stat_activity function is a system view that has been around for many years. It basically contains a list of active connections. In older versions of PostgreSQL, administrators could see that a query is waiting for somebody else—however, it was not possible to figure out why and for whom. This has changed in 9.6. Two columns have been added:

test=# \d pg_stat_activity  
View "pg_catalog.pg_stat_activity"
Column | Type | Modifiers
------------------+--------------------------+-----------
...
wait_event_type | text |
wait_event | text |
...

In addition to this extension, a new procedure has been added, which shows who caused whom to wait:

test=# SELECT * FROM pg_blocking_pids(4711);
pg_blocking_pids
------------------
{3435}
(1 row)

When the function is called, it will return a list of blocking PIDs.

主站蜘蛛池模板: 神木县| 行唐县| 桃源县| 娄烦县| 水城县| 文成县| 西盟| 江山市| 昌都县| 孙吴县| 永昌县| 莱西市| 革吉县| 南汇区| 永德县| 林口县| 炎陵县| 雷山县| 奎屯市| 灯塔市| 钟祥市| 清原| 阿城市| 蛟河市| 苗栗县| 元朗区| 栾川县| 中牟县| 宜黄县| 峡江县| 墨竹工卡县| 新宾| 铜梁县| 炎陵县| 磐石市| 思茅市| 伊金霍洛旗| 涡阳县| 定日县| 安庆市| 台江县|