summaryrefslogtreecommitdiff
path: root/src/include/statistics/extended_stats_internal.h
diff options
context:
space:
mode:
authorTomas Vondra2019-07-04 22:45:20 +0000
committerTomas Vondra2019-07-04 23:32:49 +0000
commit08aa131c7a72195113ab3a7b191fe8014dd3a898 (patch)
tree13288e10e94c6faac05a2cea6d413db98e0cf9fa /src/include/statistics/extended_stats_internal.h
parent4d66285adc6bb4f9e4fd394d478d663cbccb5fc8 (diff)
Simplify pg_mcv_list (de)serialization
The serialization format of multivariate MCV lists included alignment in order to allow direct access to part of the serialized data, but despite multiple fixes (see for example commits d85e0f366a and ea4e1c0e8f) this proved to be problematic. This commit abandons alignment in the serialized format, and just copies everything during deserialization. We now also track amount of memory needed after deserialization (including alignment), which allows us to deserialize the MCV list in a single pass. Bump catversion, as this affects contents of pg_statistic_ext_data. Backpatch to 12, where multi-column MCV lists were introduced. Author: Tomas Vondra Reviewed-by: Tom Lane Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/include/statistics/extended_stats_internal.h')
-rw-r--r--src/include/statistics/extended_stats_internal.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/statistics/extended_stats_internal.h b/src/include/statistics/extended_stats_internal.h
index fb03c52f504..8fc541993fa 100644
--- a/src/include/statistics/extended_stats_internal.h
+++ b/src/include/statistics/extended_stats_internal.h
@@ -36,6 +36,7 @@ typedef struct DimensionInfo
{
int nvalues; /* number of deduplicated values */
int nbytes; /* number of bytes (serialized) */
+ int nbytes_aligned; /* size of deserialized data with alignment */
int typlen; /* pg_type.typlen */
bool typbyval; /* pg_type.typbyval */
} DimensionInfo;