pgstat: add pgstat_copy_relation_stats().

Andres Freund <andres@anarazel.de>

Commit: 8ea7963fc741b6f403a544d56ad0ecf78e5237b1
Author: Andres Freund <andres@anarazel.de>
Date: 2022-04-06T21:09:18Z
Releases: 15.0
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

Files

PathChange+/−
src/backend/catalog/index.c modified +2 −24
src/backend/utils/activity/pgstat_relation.c modified +32 −0
src/include/pgstat.h modified +2 −0

Discussion