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

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.

主站蜘蛛池模板: 兴城市| 巨鹿县| 抚远县| 深水埗区| 田林县| 基隆市| 九龙城区| 景谷| 丰台区| 莒南县| 无为县| 望奎县| 襄汾县| 保亭| 融水| 湟中县| 都江堰市| 张家川| 景洪市| 类乌齐县| 旌德县| 甘南县| 诸暨市| 杭锦后旗| 石棉县| 宣恩县| 永丰县| 奎屯市| 巴中市| 沽源县| 盐池县| 东至县| 肇庆市| 滦平县| 开封县| 江陵县| 治多县| 巩留县| 岢岚县| 尉氏县| 临湘市|