Re: Remove toast_max_chunk_size from control file

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Remove toast_max_chunk_size from control file
Date: 2026-09-07 01:25:34
Message-ID: 149283.1788744334@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Paquier <michael(at)paquier(dot)xyz> 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2026-09-07 01:34:50 Re: Remove toast_max_chunk_size from control file
Previous Message Michael Paquier 2026-09-07 01:18:38 Remove toast_max_chunk_size from control file