Take the statistics collector out of the loop for monitoring backends'
Tom Lane <tgl@sss.pgh.pa.us>
Take the statistics collector out of the loop for monitoring backends' current commands; instead, store current-status information in shared memory. This substantially reduces the overhead of stats_command_string and also ensures that pg_stat_activity is fully up to date at all times. Per my recent proposal.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/config.sgml | modified | +73 −61 |
| doc/src/sgml/monitoring.sgml | modified | +36 −23 |
| src/backend/postmaster/pgstat.c | modified | +497 −727 |
| src/backend/postmaster/postmaster.c | modified | +1 −8 |
| src/backend/storage/ipc/ipci.c | modified | +4 −1 |
| src/backend/storage/ipc/procarray.c | modified | +1 −37 |
| src/backend/utils/adt/pgstatfuncs.c | modified | +81 −136 |
| src/backend/utils/misc/guc.c | modified | +12 −11 |
| src/backend/utils/misc/postgresql.conf.sample | modified | +8 −8 |
| src/include/pgstat.h | modified | +124 −142 |
| src/include/storage/procarray.h | modified | +1 −2 |