Thread: pgsql: Add a note about another issue that needs to be considered before

pgsql: Add a note about another issue that needs to be considered before

From
tgl@postgresql.org (Tom Lane)
Date:
Log Message:
-----------
Add a note about another issue that needs to be considered before
changing the TOAST size thresholds.

Modified Files:
--------------
    pgsql/src/include/access:
        tuptoaster.h (r1.35 -> r1.36)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/access/tuptoaster.h?r1=1.35&r2=1.36)

Re: pgsql: Add a note about another issue that needs to be considered before

From
Gregory Stark
Date:
"Tom Lane" <tgl@postgresql.org> writes:

> Log Message:
> -----------
> Add a note about another issue that needs to be considered before
> changing the TOAST size thresholds.

FWIW I found another issue with this variable when I was experimenting with
small block sizes. If you set the target <= the tuple header the toaster
breaks. This is because it's doing unsigned arithmetic (Size is unsigned). I
think the right solution is just to change it to use plain int32 arithmetic
everywhere.

I don't think this affects the default thresholds because even with the
maximum number of columns (1600) the null bitmap can't be as large as 2kB (the
most it can get to is 200 bytes).

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's PostGIS support!

Gregory Stark <stark@enterprisedb.com> writes:
> FWIW I found another issue with this variable when I was experimenting with
> small block sizes. If you set the target <= the tuple header the toaster
> breaks. This is because it's doing unsigned arithmetic (Size is unsigned). I
> think the right solution is just to change it to use plain int32 arithmetic
> everywhere.

Somehow I can't get excited about that.  If we ever do open things up to
allow user control of the target, we'd certainly constrain it to a sane
range.

            regards, tom lane

Re: pgsql: Add a note about another issue that needs to be considered before

From
Gregory Stark
Date:
"Tom Lane" <tgl@sss.pgh.pa.us> writes:

> Gregory Stark <stark@enterprisedb.com> writes:
>> FWIW I found another issue with this variable when I was experimenting with
>> small block sizes. If you set the target <= the tuple header the toaster
>> breaks. This is because it's doing unsigned arithmetic (Size is unsigned). I
>> think the right solution is just to change it to use plain int32 arithmetic
>> everywhere.
>
> Somehow I can't get excited about that.  If we ever do open things up to
> allow user control of the target, we'd certainly constrain it to a sane
> range.

Yeah, i didn't even mention it at the time. I just thought I would mention it
now since you were adding comments on restrictions to the toast threshold.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's Slony Replication support!