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

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.

主站蜘蛛池模板: 鲁甸县| 嘉善县| 巴林右旗| 三穗县| 黄大仙区| 阳曲县| 高密市| 克拉玛依市| 石渠县| 鄂托克前旗| 九寨沟县| 北安市| 周宁县| 瑞昌市| 林西县| 斗六市| 曲麻莱县| 呼伦贝尔市| 玛沁县| 瓦房店市| 汪清县| 元朗区| 临沂市| 都兰县| 铜川市| 贵南县| 新泰市| 武威市| 陕西省| 炎陵县| 丰原市| 色达县| 永春县| 彭山县| 新绛县| 探索| 颍上县| 萍乡市| 舞阳县| 师宗县| 青海省|