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

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.

主站蜘蛛池模板: 泌阳县| 甘谷县| 宕昌县| 如皋市| 嘉定区| 湘潭县| 胶州市| 镇康县| 湘潭市| 福建省| 阿图什市| 巨鹿县| 广平县| 长葛市| 西安市| 镇宁| 怀来县| 广宗县| 阿城市| 尚志市| 靖州| 新竹市| 商都县| 平凉市| 闵行区| 土默特右旗| 高要市| 五大连池市| 调兵山市| 炎陵县| 肥城市| 河池市| 霍邱县| 大埔县| 同仁县| 云南省| 龙口市| 合阳县| 巴南区| 渝北区| 鄂伦春自治旗|