- Mastering PostgreSQL 10
- Hans Jürgen Sch?nig
- 205字
- 2021-06-30 19:03:47
Using additional information in pg_stat_activity
Before PostgreSQL 10.0, pg_stat_activity only contained information about normal backend processes serving end users (connections). However, this has changed. Since PostgreSQL 10.0, a lot more information is exposed. It is possible to figure out what these other system processes are doing.
The following listing shows the content of pg_stat_activity on an idle database instance:
test=# \x Expanded display is on.
test=# SELECT pid, wait_event_type, wait_event, backend_type FROM pg_stat_activity ;
-[ RECORD 1 ]---+-------------------- pid | 12159 wait_event_type | Activity wait_event | AutoVacuumMain backend_type | autovacuum launcher -[ RECORD 2 ]---+-------------------- pid | 12161 wait_event_type | Activity wait_event | LogicalLauncherMain backend_type | background worker -[ RECORD 3 ]---+-------------------- pid | 12628 wait_event_type | wait_event | backend_type | client backend -[ RECORD 4 ]---+-------------------- pid | 12156 wait_event_type | Activity wait_event | BgWriterMain backend_type | background writer -[ RECORD 5 ]---+-------------------- pid | 12155 wait_event_type | Activity wait_event | CheckpointerMain backend_type | checkpointer -[ RECORD 6 ]---+-------------------- pid | 12157 wait_event_type | Activity wait_event | WalWriterMain backend_type | walwriter
What you see here is that every server process is listed. It will allow you to gain some insights into what is happening the server.
推薦閱讀
- Dreamweaver CS3+Flash CS3+Fireworks CS3創意網站構建實例詳解
- 城市道路交通主動控制技術
- 現代傳感技術
- 21天學通C語言
- 變頻器、軟啟動器及PLC實用技術260問
- 精通數據科學算法
- Mastering ServiceNow Scripting
- Mastering Geospatial Analysis with Python
- Apache源代碼全景分析(第1卷):體系結構與核心模塊
- Spark大數據商業實戰三部曲:內核解密|商業案例|性能調優
- 從零開始學ASP.NET
- 網絡信息安全項目教程
- Hands-On Generative Adversarial Networks with Keras
- Flash CS3動畫制作融會貫通
- Mastercam X5應用技能基本功特訓