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

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.

主站蜘蛛池模板: 陆良县| 通化市| 嵊泗县| 扎兰屯市| 岚皋县| 和平县| 广州市| 青河县| 桂林市| 波密县| 同仁县| 天长市| 清徐县| 开原市| 湘西| 拉萨市| 阿克| 汕尾市| 湘西| 广安市| 农安县| 乐都县| 吴川市| 永州市| 娄烦县| 囊谦县| 黄大仙区| 东宁县| 德格县| 合肥市| 新源县| 昌图县| 福贡县| 肃北| 平安县| 栾城县| 博野县| 湖北省| 西丰县| 榆树市| 门源|