Reduce overhead of pg_mcv_list (de)serialization Commit ea4e1c0e8f resolved issues with memory alignment in serialized pg_mcv_list values, but it required copying data to/from the varlena buffer during serialization and deserialization. As the MCV lits may be fairly large, the overhead (memory consumption, CPU usage) can get rather significant too.
This change tweaks the serialization format so that the alignment is correct with respect to the varlena value, and so the parts may be accessed directly without copying the data. Catversion bump, as it affects existing pg_statistic_ext data. Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/c50b3158bfd7fc8c2a0b2d2ede4415fd9859acd1 Modified Files -------------- src/backend/statistics/mcv.c | 116 ++++++++++++++++++++++++++------------- src/include/catalog/catversion.h | 2 +- 2 files changed, 78 insertions(+), 40 deletions(-)