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

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.

主站蜘蛛池模板: 昭平县| 宁德市| 若尔盖县| 二连浩特市| 涟源市| 鱼台县| 苏尼特左旗| 通渭县| 喀喇沁旗| 本溪| 易门县| 扶绥县| 肃南| 新巴尔虎右旗| 宁南县| 涡阳县| 松原市| 嘉峪关市| 梅河口市| 兴和县| 玉林市| 永嘉县| 无极县| 乐清市| 兰考县| 裕民县| 桃江县| 长汀县| 行唐县| 江安县| 昌乐县| 民乐县| 闸北区| 泾川县| 新乡市| 巩义市| 八宿县| 资阳市| 淅川县| 泰和县| 团风县|