Hello,

I would like to request a cleaner explanation of default_toast_compression 
parameter. It could be just me, but following sentence could be misread:

"This variable sets the default 
TOAST<https://www.postgresql.org/docs/18/storage-toast.html> compression method 
for values of compressible columns."
(https://www.postgresql.org/docs/18/runtime-config-client.html#GUC-DEFAULT-TOAST-COMPRESSION)

The way I read it (and perhaps I'm not the only one): "If column value is too 
big to be stored in-row it goes to TOAST and gets compressed with algorithm set 
by default_toast_compression parameter"

This leads to the suggestion that initially this column gets compressed by pglz 
as default algo and if tuple is bigger than 2000 bytes, the column gets 
compressed with algo defined by default_toast_compression and saved into the 
TOAST table. This raises suggestion about compressing same string data twice 
when default_toast_compression=lz4:

  1.
in an attempt to save string in-tuple with pglz;
  2.
with lz4 to save it in the TOAST table.

Perhaps something like following will avoid misreading:

"This variable sets the default compression method for values of compressible 
columns to be stored in-tuple or TOAST table."

Best regards,
Boris

Reply via email to