Reduce overhead of pg_mcv_list (de)serialization
authorTomas Vondra <tomas.vondra@postgresql.org>
Wed, 3 Apr 2019 19:08:36 +0000 (21:08 +0200)
committerTomas Vondra <tomas.vondra@postgresql.org>
Wed, 3 Apr 2019 19:23:40 +0000 (21:23 +0200)
commitc50b3158bfd7fc8c2a0b2d2ede4415fd9859acd1
tree308a26a57a5d48ef43f323b9dec7731c03868416
parentb0b39f72b9904bcb80f97b35837ccff1578aa4b8
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.
src/backend/statistics/mcv.c
src/include/catalog/catversion.h