作者
digoal
日期
2021-04-04
标签
PostgreSQL , backend_progress , backend_status , wait_event , pgstat
背景
PostgreSQL 14 preview - 活跃会话pg_stat_activity、进程进度条pg_stat_progress* 、等待事件wait_event等 信息 从 pgstat 代码 拆出
pgstat.[ch] c文件和h头文件分别拆到:
- backend_progress.[ch]
- backend_status.[ch]
- wait_event.[ch]
很赞很工整.
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=e1025044cd4e7f33f7304aed54d5778b8a82cd5d
```
Split backend status and progress related functionality out of pgstat.c.
author Andres Freund andres@anarazel.de
Sat, 3 Apr 2021 18:42:52 +0000 (11:42 -0700)
committer Andres Freund andres@anarazel.de
Sat, 3 Apr 2021 18:42:52 +0000 (11:42 -0700)
commit e1025044cd4e7f33f7304aed54d5778b8a82cd5d
tree 2f35b9816d3d9040a4629f3899a137a7179565e8 tree
parent 8d3a4c3eae5367fba60ab77c159814defba784fe commit | diff
Split backend status and progress related functionality out of pgstat.c.
Backend status (supporting pg_stat_activity) and command
progress (supporting pg_stat_progress*) related code is largely
independent from the rest of pgstat.[ch] (supporting views like
pg_stat_all_tables that accumulate data over time). See also
a333476b925.
This commit doesn't rename the function names to make the distinction
from the rest of pgstat_ clearer - that'd be more invasive and not
clearly beneficial. If we were to decide to do such a rename at some
point, it's better done separately from moving the code as well.
Robert's review was of an earlier version.
Reviewed-By: Robert Haas robertmhaas@gmail.com
Discussion: https://postgr.es/m/20210316195440.twxmlov24rr2nxrg@alap3.anarazel.de
src/backend/bootstrap/bootstrap.c diff | blob | blame | history
src/backend/postmaster/pgstat.c diff | blob | blame | history
src/backend/utils/activity/Makefile diff | blob | blame | history
src/backend/utils/activity/backend_progress.c [new file with mode: 0644] blob
src/backend/utils/activity/backend_status.c [new file with mode: 0644] blob
src/backend/utils/init/postinit.c diff | blob | blame | history
src/backend/utils/misc/guc.c diff | blob | blame | history
src/include/commands/progress.h diff | blob | blame | history
src/include/pgstat.h diff | blob | blame | history
src/include/utils/backend_progress.h [new file with mode: 0644] blob
src/include/utils/backend_status.h [new file with mode: 0644] blob
```
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=a333476b925134f6185037eaff3424c07a9f466f
```
Split wait event related code from pgstat.[ch] into wait_event.[ch].
author Andres Freund andres@anarazel.de
Sat, 3 Apr 2021 02:45:24 +0000 (19:45 -0700)
committer Andres Freund andres@anarazel.de
Sat, 3 Apr 2021 03:02:26 +0000 (20:02 -0700)
commit a333476b925134f6185037eaff3424c07a9f466f
tree 6e5aa805226348fc9bb5a3fb99db25cc8a4dab40 tree
parent 1267d9862fc6a4f8cdc0ca38d1988b61f39da585 commit | diff
Split wait event related code from pgstat.[ch] into wait_event.[ch].
The wait event related code is independent from the rest of the
pgstat.[ch] code, of nontrivial size and changes on a regular
basis. Put it into its own set of files.
As there doesn't seem to be a good pre-existing directory for code
like this, add src/backend/utils/activity.
Reviewed-By: Robert Haas robertmhaas@gmail.com
Discussion: https://postgr.es/m/20210316195440.twxmlov24rr2nxrg@alap3.anarazel.de
src/backend/postmaster/pgstat.c diff | blob | blame | history
src/backend/utils/Makefile diff | blob | blame | history
src/backend/utils/activity/Makefile [new file with mode: 0644] blob
src/backend/utils/activity/wait_event.c [new file with mode: 0644] blob
src/include/pgstat.h diff | blob | blame | history
src/include/utils/wait_event.h [new file with mode: 0644] blob
```
PostgreSQL 许愿链接
您的愿望将传达给PG kernel hacker、数据库厂商等, 帮助提高数据库产品质量和功能, 说不定下一个PG版本就有您提出的功能点. 针对非常好的提议,奖励限量版PG文化衫、纪念品、贴纸、PG热门书籍等,奖品丰富,快来许愿。开不开森.
9.9元购买3个月阿里云RDS PostgreSQL实例
PostgreSQL 解决方案集合
德哥 / digoal's github - 公益是一辈子的事.





