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

From Amit Kapila
Subject Re: TOAST condition for column size
Date
Msg-id CAA4eK1LrJpAHbZ3=B3GDY2w2V9QDEy0tsitAjK2BMAt+Ufo4Mw@mail.gmail.com
Whole thread Raw
In response to TOAST condition for column size  (torikoshia <torikoshia@oss.nttdata.com>)
List pgsql-hackers
On Mon, Jan 18, 2021 at 7:53 PM torikoshia <torikoshia@oss.nttdata.com> wrote:
>
> Hi,

> I confirmed these sizes in my environment but AFAIU they would be
> the same size in any environment.
>
> So, as a result of adjusting the alignment, 20~23 bytes seems to
> fail.
>
> I wonder if it might be better not to adjust the alignment here
> as an attached patch because it succeeded in inserting 20~23
> bytes records.
> Or is there reasons to add the alignment here?
>

Because no benefit is to be expected by compressing it. The size will
be mostly the same. Also, even if we somehow try to fit this data via
toast, I think reading speed will be slower because for all such
columns an extra fetch from toast would be required. Another thing is
you or others can still face the same problem with 17-byte column
data. I don't this is the right way to fix it. I don't have many good
ideas but I think you can try by (a) increasing block size during
configure, (b) reduce the number of columns, (c) create char columns
of somewhat bigger size say greater than 24 bytes to accommodate your
case.

I know none of these are good workarounds but at this moment I can't
think of better alternatives.

-- 
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: configurable the threshold for warning due to run out of transaction ID
Next
From: Laurenz Albe
Date:
Subject: Re: Add primary keys to system catalogs