• Tomas Vondra's avatar
    Simplify pg_mcv_list (de)serialization · 08aa131c
    Tomas Vondra authored
    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 d85e0f36 and ea4e1c0e) 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/2201.1561521148@sss.pgh.pa.us
    08aa131c
mcv.c 54.7 KB