Re: tableam vs. TOAST

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: tableam vs. TOAST
Дата
Msg-id 20191106170018.gcma4qfblxoqnsgc@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: tableam vs. TOAST  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: tableam vs. TOAST  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Re: tableam vs. TOAST  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Hi,

On 2019-11-06 11:49:10 -0500, Robert Haas wrote:
> On Wed, Nov 6, 2019 at 11:25 AM Andres Freund <andres@anarazel.de> wrote:
> > I think it's more than just that. It's also that I think presenting a
> > hardcoded value to the outside of / above an AM is architecturally
> > wrong. If anything this is an implementation detail of the AM, that the
> > AM ought to be concerned with internally, not something it should
> > present to the outside.
> 
> I mean, it depends on your vision of how things ought to be
> abstracted. If you want the TOAST stuff to be logically "below" the
> table AM layer, then this is an abstraction violation. But if you
> think of TOAST as being a parallel system to table AM, then it's fine.
> It also depends on your goals. If you want to give the table AM
> maximum freedom to do what it likes, the design I proposed is not very
> good. If you want to make it easy for someone to plug in a new AM that
> does toasting like the current heap but with a different chunk size,
> that design lets you do so with a very minimal amount of code.

I'd like an AM to have the *option* of implementing something better, or
at least go in the direction of making that possible.

It seems perfectly possible to have a helper function implementing the
current logic that you just can call with the fixed chunk size as an
additional parameter. Which'd basically mean there's no meaningful
difference in complexity compared to providing the chunk size as an
external AM property. In one case you have a callback that just calls a
helper function with one parameter, in the other you fill in a member of
the struct.


Greetings,

Andres Freund



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: tableam vs. TOAST
Следующее
От: Pierre Ducroquet
Дата:
Сообщение: [Patch] optimizer - simplify $VAR1 IS NULL AND $VAR1 IS NOT NULL