pg_wait_events

描述等待事件的系统视图

pg_wait_events 是一个提供等待事件描述的系统目录视图。

pg_wait_eventsPostgreSQL 17中添加。

更改历史

示例

来自pg_wait_events的示例内容

postgres=# SELECT * FROM pg_wait_events LIMIT 3;
   type   |       name        |                     description                     
----------+-------------------+-----------------------------------------------------
 Activity | ArchiverMain      | Waiting in main loop of archiver process
 Activity | AutoVacuumMain    | Waiting in main loop of autovacuum launcher process
 Activity | BgWriterHibernate | Waiting in background writer process, hibernating
(3 rows)

pg_wait_events 可以与pg_stat_activity联接

postgres=# SELECT psa.pid, psa.application_name, psa.wait_event,
                  we.description
             FROM pg_stat_activity psa
             JOIN pg_wait_events we
               ON (psa.wait_event_type = we.type AND
                   psa.wait_event = we.name);
  pid  | application_name |     wait_event      |                         description                          
-------+------------------+---------------------+--------------------------------------------------------------
 16252 |                  | AutoVacuumMain      | Waiting in main loop of autovacuum launcher process
 16249 |                  | BgWriterMain        | Waiting in main loop of background writer process
 16248 |                  | CheckpointerMain    | Waiting in main loop of checkpointer process
 16253 |                  | LogicalLauncherMain | Waiting in main loop of logical replication launcher process
 16251 |                  | WalWriterMain       | Waiting in main loop of WAL writer process
(5 rows)

分类

性能系统目录

反馈

提交任何关于"pg_wait_events"的评论、建议或更正 此处