postgresql/src/backend
Andres Freund 7890a42347 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.
2021-09-16 02:10:57 -07:00
..
access Send NOTIFY signals during CommitTransaction. 2021-09-14 17:18:25 -04:00
bootstrap Rethink definition of pg_attribute.attcompression. 2021-05-27 13:24:27 -04:00
catalog Invalidate relcache for publications defined for all tables. 2021-09-08 12:08:29 +05:30
commands Send NOTIFY signals during CommitTransaction. 2021-09-14 17:18:25 -04:00
executor Fix missing words in comment. 2021-09-07 10:30:04 +03:00
foreign Update copyright for 2021 2021-01-02 13:06:25 -05:00
jit jit: Do not try to shut down LLVM state in case of LLVM triggered errors. 2021-09-13 18:15:28 -07:00
lib Fix typo in comment 2021-04-20 14:35:16 +02:00
libpq Set type identifier on BIO 2021-08-17 14:30:25 +02:00
main Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodes Change the name of the Result Cache node to Memoize 2021-07-14 12:45:00 +12:00
optimizer Fix planner error with multiple copies of an AlternativeSubPlan. 2021-09-14 15:11:21 -04:00
parser Disable anonymous record hash support except in special cases 2021-09-08 09:55:18 +02:00
partitioning Avoid using ambiguous word "non-negative" in error messages. 2021-07-28 01:21:35 +09:00
po Translation updates 2021-08-09 11:51:59 +02:00
port Make EXEC_BACKEND more convenient on macOS. 2021-08-13 11:11:59 +12:00
postmaster Fix performance regression from session statistics. 2021-09-16 02:10:57 -07:00
regex Make pg_regexec() robust against out-of-range search_start. 2021-09-11 15:19:43 -04:00
replication Fix reorder buffer memory accounting for toast changes. 2021-09-13 10:35:00 +05:30
rewrite Fix rewriter to set hasModifyingCTE correctly on rewritten queries. 2021-09-08 12:05:43 -04:00
snowball Update snowball 2021-02-19 08:10:15 +01:00
statistics Error message refactoring 2021-06-27 09:41:16 +02:00
storage Fix variable shadowing in procarray.c. 2021-09-16 13:07:10 +09:00
tcop Fix performance regression from session statistics. 2021-09-16 02:10:57 -07:00
tsearch Fix typos and grammar in comments and docs 2021-04-19 11:32:30 +09:00
utils Fix performance regression from session statistics. 2021-09-16 02:10:57 -07:00
.gitignore
Makefile Use sort_template.h for qsort_tuple() and qsort_ssup(). 2021-03-03 17:02:32 +13:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk Translation updates 2021-05-10 14:36:21 +02:00