- Mastering PostgreSQL 9.6
- Hans Jurgen Schonig
- 129字
- 2021-07-09 19:57:09
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.
推薦閱讀
- Design for the Future
- AWS:Security Best Practices on AWS
- Visual C# 2008開發技術實例詳解
- 機器自動化控制器原理與應用
- Python Algorithmic Trading Cookbook
- 基于多目標決策的數據挖掘方法評估與應用
- Ceph:Designing and Implementing Scalable Storage Systems
- 具比例時滯遞歸神經網絡的穩定性及其仿真與應用
- 奇點將至
- Windows 7故障與技巧200例
- 計算機硬件技術基礎學習指導與練習
- ROS Robotics By Example(Second Edition)
- Office 2010輕松入門
- 從實踐中學嵌入式Linux操作系統
- 單片機原理、接口及應用系統設計