Why does "toast_tuple_target" allow values below TOAST_TUPLE_TARGET?

Поиск
Список
Период
Сортировка
От David Rowley
Тема Why does "toast_tuple_target" allow values below TOAST_TUPLE_TARGET?
Дата
Msg-id CAKJS1f9vrJ55oYe7un+rakTzwaGh3my5MA0RBfyNngAXu7eVeQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Why does "toast_tuple_target" allow values belowTOAST_TUPLE_TARGET?  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Список pgsql-hackers
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



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

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: [HACKERS] Block level parallel vacuum
Следующее
От: Andrey Borodin
Дата:
Сообщение: Re: [GSoC] application ideas