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

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.

主站蜘蛛池模板: 丹巴县| 韶山市| 仁化县| 固镇县| 克东县| 龙海市| 安阳县| 孟州市| 荥阳市| 天全县| 江陵县| 茂名市| 全椒县| 温州市| 临高县| 南丰县| 莒南县| 德阳市| 东至县| 鄄城县| 海淀区| 色达县| 泰安市| 酒泉市| 遂昌县| 城步| 甘孜县| 吴堡县| 淳安县| 江油市| 宁强县| 清水河县| 禹州市| 香格里拉县| 南阳市| 大姚县| 宁蒗| 万年县| 吴江市| 沅江市| 宝鸡市|