Michael Paquier <[email protected]> writes:
> My main argument regarding the removal of toast_max_chunk_size in the
> control file is that it is a redundant check, due to the fact that the
> definition of TOAST_OID_MAX_CHUNK_SIZE is tied to two fields that we
> already track in the control file:
> - BLCKSZ
> - MAXALIGN

I don't think this follows.  heaptoast.h says:

#define EXTERN_TUPLES_PER_PAGE    4    /* tweak only this */

#define EXTERN_TUPLE_MAX_SIZE    MaximumBytesPerTuple(EXTERN_TUPLES_PER_PAGE)

#define TOAST_MAX_CHUNK_SIZE    \
    (EXTERN_TUPLE_MAX_SIZE -                            \
     MAXALIGN(SizeofHeapTupleHeader) -                  \
     sizeof(Oid) -                                      \
     sizeof(int32) -                                    \
     VARHDRSZ)

EXTERN_TUPLES_PER_PAGE is a free variable here, and it's entirely
possible that someone would wish to tweak it.  So I disagree that
it's safe to remove this value from pg_control.

                        regards, tom lane


Reply via email to