Re: TOASTing smaller things - Mailing list pgsql-hackers

From Tom Lane
Subject Re: TOASTing smaller things
Date
Msg-id 12692.1174500331@sss.pgh.pa.us
Whole thread Raw
In response to TOASTing smaller things  (Chris Browne <cbbrowne@acm.org>)
Responses Re: TOASTing smaller things  (Jan Wieck <JanWieck@Yahoo.com>)
List pgsql-hackers
Chris Browne <cbbrowne@acm.org> writes:
> #define TOAST_DENOMINATOR 17  
>    /* Use this as the divisor; current default behaviour falls from TOAST_DENOMINATOR = 4 */

> #define TOAST_TUPLE_THRESHOLD^I\
> ^IMAXALIGN_DOWN((BLCKSZ - \
> ^I^I^I^I   MAXALIGN(sizeof(PageHeaderData) + 3 * sizeof(ItemIdData))) \
> ^I^I^I^I  / TOAST_DENOMINATOR)

Given that you are quoting code that was demonstrably broken since the
original coding of TOAST up till a month or two back, "it passes
regression" is not adequate proof of "it's right".  In fact I think
it's not right; you have not got the roundoff condition straight.

> 4.  A different mechanism would be to add a fifth storage column
> strategy (the present four are PLAIN, EXTENDED, EXTERNAL, MAIN), let's
> say, TOAST.

Anything along this line would require invoking the toaster on every
single tuple, since we'd always have to crawl through all the columns
to see if toasting was supposed to happen.  No thanks.

> Which of these sounds preferable?

It's a bit late in the cycle to be proposing any of these for 8.3.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Florian G. Pflug"
Date:
Subject: Re: CREATE INDEX and HOT - revised design
Next
From: "Merlin Moncure"
Date:
Subject: Re: CREATE INDEX and HOT - revised design