Re: TOAST condition for column size - Mailing list pgsql-hackers

From Tom Lane
Subject Re: TOAST condition for column size
Date
Msg-id 479998.1611070839@sss.pgh.pa.us
Whole thread Raw
In response to Re: TOAST condition for column size  (Dilip Kumar <dilipbalaut@gmail.com>)
Responses Re: TOAST condition for column size  (torikoshia <torikoshia@oss.nttdata.com>)
List pgsql-hackers
Dilip Kumar <dilipbalaut@gmail.com> writes:
> On Tue, 19 Jan 2021 at 6:28 PM, Amit Kapila <amit.kapila16@gmail.com> wrote:
>> Won't it be safe because we don't align individual attrs of type
>> varchar where length is less than equal to 127?

> Yeah right,  I just missed that point.

Yeah, the minimum on biggest_size has nothing to do with alignment
decisions.  It's just a filter to decide whether it's worth trying
to toast anything.

Having said that, I'm pretty skeptical of this patch: I think its
most likely real-world effect is going to be to waste cycles (and
create TOAST-table bloat) on the way to failing anyway.  I do not
think that toasting a 20-byte field down to 18 bytes is likely to be
a productive thing to do in typical situations.  The given example
looks like a cherry-picked edge case rather than a useful case to
worry about.

IOW, if I were asked to review whether the current minimum is
well-chosen, I'd be wondering if we should increase it not
decrease it.

            regards, tom lane



pgsql-hackers by date:

Previous
From: James Hilliard
Date:
Subject: Re: [PATCH 1/1] Fix detection of pwritev support for OSX.
Next
From: Tom Lane
Date:
Subject: Re: Use boolean array for nulls parameters