Re: Index on (fixed size) bytea value

From: Les <nagylzs(at)gmail(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: Index on (fixed size) bytea value
Date: 2023-06-20 07:18:31
Message-ID: CAKXe9UCKJfjtgniRmBZfz6rMvyML38xVZ6tebEui-KiHpC+ArQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

>
>
> Then you would ALTER the column and SET STORAGE MAIN, so that it does not
> ever use TOAST.
>
> The size limit for a row would then be 8kB minus page header minus row
> header, which
> should be somewhere in the vicinity of 8140 bytes.
>
> If you want your block size to be a power of two, the limit would be 4kB,
> which would waste
> almost half your storage space.
>

Oh I see. So if I want to save some space for future columns, then storing
about 7500 bytes in the "block bytea" column would be close to optimal,
utilizing more than 90% of the block space. I guess that the fillfactor
setting will have no effect on this table, and it does not matter if I set
it or not.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message nicolas paris 2023-06-20 10:02:17 Re: Merge David and Goliath tables efficiently
Previous Message Laurenz Albe 2023-06-20 06:50:58 Re: Index on (fixed size) bytea value