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

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.

主站蜘蛛池模板: 龙游县| 寻甸| 白朗县| 天气| 齐河县| 镇平县| 峨眉山市| 南康市| SHOW| 乌海市| 双峰县| 新化县| 自贡市| 昭通市| 屯留县| 杂多县| 河北省| 诸暨市| 金门县| 永吉县| 莱芜市| 阿克| 中超| 宁蒗| 什邡市| 辽源市| 柳河县| 揭阳市| 原平市| 广宁县| 古交市| 永宁县| 龙井市| 凯里市| 开阳县| 阳西县| 毕节市| 乐山市| 睢宁县| 漾濞| 华亭县|