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

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.

主站蜘蛛池模板: 荣昌县| 平谷区| 高阳县| 赣州市| 突泉县| 贺州市| 奉化市| 焉耆| 安国市| 定结县| 巨野县| 鄯善县| 凌源市| 安乡县| 拜城县| 邯郸县| 遂平县| 巩义市| 筠连县| 尼勒克县| 霍邱县| 富源县| 清水县| 安康市| 怀仁县| 黄梅县| 庄浪县| 留坝县| 宜君县| 凤翔县| 巫山县| 云和县| 老河口市| 鸡西市| 昆山市| 天津市| 临武县| 葫芦岛市| 泊头市| 东乡族自治县| 遂宁市|