pgstat: add pgstat_copy_relation_stats().
authorAndres Freund <andres@anarazel.de>
Wed, 6 Apr 2022 21:09:18 +0000 (14:09 -0700)
committerAndres Freund <andres@anarazel.de>
Wed, 6 Apr 2022 21:09:18 +0000 (14:09 -0700)
commit8ea7963fc741b6f403a544d56ad0ecf78e5237b1
treec8bf72f14c205b147a4d4559775fd224b465b1e6
parentcc96373cf39bbfb386a40a47b7f0ea8f051f1838
pgstat: add pgstat_copy_relation_stats().

Until now index_concurrently_swap() directly modified pgstat internal
datastructures. That will break with the introduction of shared memory
statistics and seems off architecturally.

This is done separately from the - quite large - shared memory statistics
patch to make review easier.

Author: Andres Freund <andres@anarazel.de>
Author: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Reviewed-By: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Discussion: https://postgr.es/m/20220303021600.hs34ghqcw6zcokdh@alap3.anarazel.de
src/backend/catalog/index.c
src/backend/utils/activity/pgstat_relation.c
src/include/pgstat.h