Обсуждение: Why does "toast_tuple_target" allow values below TOAST_TUPLE_TARGET?

Поиск
Список
Период
Сортировка

Why does "toast_tuple_target" allow values below TOAST_TUPLE_TARGET?

От
David Rowley
Дата:
Or rather, why does the reloption allow values below the compile-time constant?

It looks like we currently allow values as low as 128.  The problem
there is that heap_update() and heap_prepare_insert() both only bother
calling toast_insert_or_update() when the tuple's length is above
TOAST_TUPLE_TARGET, so it seems to have no effect when set to a lower
value.

I don't think we can change heap_update() and heap_prepare_insert() to
do "tup->t_len > RelationGetToastTupleTarget(relation,
TOAST_TUPLE_TARGET)" instead as such a table might not even have a
TOAST relation since needs_toast_table() will return false if it
thinks the tuple length can't be above TOAST_TUPLE_TARGET.

It does not seem possible to add/remote the toast table when the
reloption is changed either as we're only obtaining a
ShareUpdateExclusiveLock to set it. We'd likely need to upgrade that
to an AccessExclusiveLock to do that.

I understand from reading [1] that Simon was mostly interested in
keeping values inline for longer. I saw no mention of moving them out
of line sooner.

[1] https://postgr.es/m/CANP8+jKsVmw6CX6YP9z7zqkTzcKV1+Uzr3XjKcZW=2Ya00OyQQ@mail.gmail.com

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services



Re: Why does "toast_tuple_target" allow values belowTOAST_TUPLE_TARGET?

От
Amit Langote
Дата:
On 2019/04/05 14:09, David Rowley wrote:
> Or rather, why does the reloption allow values below the compile-time constant?

Maybe there is already a discussion in progress on the topic?

* Caveats from reloption toast_tuple_target *
https://www.postgresql.org/message-id/flat/CABOikdMt%3DmOtzW_ax_8pa9syEPo5Lji%3DLJrN2dunht8K-SLWzg%40mail.gmail.com

Thanks,
Amit




Re: Why does "toast_tuple_target" allow values below TOAST_TUPLE_TARGET?

От
David Rowley
Дата:
On Fri, 5 Apr 2019 at 18:25, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> wrote:
>
> On 2019/04/05 14:09, David Rowley wrote:
> > Or rather, why does the reloption allow values below the compile-time constant?
>
> Maybe there is already a discussion in progress on the topic?
>
> * Caveats from reloption toast_tuple_target *
> https://www.postgresql.org/message-id/flat/CABOikdMt%3DmOtzW_ax_8pa9syEPo5Lji%3DLJrN2dunht8K-SLWzg%40mail.gmail.com

Doh. Okay, thanks. I'll drop this thread then. Seems what I wanted to
ask and say has been asked and said already.

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services