git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: dc89914) | patch
Fix performance regression from session statistics.
2021年9月16日 09:02:40 +0000 (02:02 -0700)
2021年9月16日 09:05:50 +0000 (02:05 -0700)
commit 37a9aa659111c454386b7055dcd3809e45bc17de
Fix performance regression from session statistics.

Session statistics, as introduced by 960869da08, had several shortcomings:

- an additional GetCurrentTimestamp() call that also impaired the accuracy of
the data collected

This can be avoided by passing the current timestamp we already have in
pgstat_report_stat().

- an additional statistics UDP packet sent every 500ms

This is solved by adding the new statistics to PgStat_MsgTabstat.
This is conceptually ugly, because session statistics are not
table statistics. But the struct already contains data unrelated
to tables, so there is not much damage done.

Connection and disconnection are reported in separate messages, which
reduces the number of additional messages to two messages per session and a
slight increase in PgStat_MsgTabstat size (but the same number of table
stats fit).

- Session time computation could overflow on systems where long is 32 bit.

Reported-By: Andres Freund <andres@anarazel.de>
Author: Andres Freund <andres@anarazel.de>
Author: Laurenz Albe <laurenz.albe@cybertec.at>
Discussion: https://postgr.es/m/20210801205501.nyxzxoelqoo4x2qc%40alap3.anarazel.de
Backpatch: 14-, where the feature was introduced.
src/backend/postmaster/pgstat.c diff | blob | blame | history
src/backend/tcop/postgres.c diff | blob | blame | history
src/backend/utils/activity/backend_status.c diff | blob | blame | history
src/include/pgstat.h diff | blob | blame | history
src/tools/pgindent/typedefs.list diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /