Re: Caveats from reloption toast_tuple_target

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Simon Riggs <simon(at)2ndquadrant(dot)com>
Subject: Re: Caveats from reloption toast_tuple_target
Date: 2019-04-03 16:13:51
Message-ID: CA+TgmobsWaG1p+snDO8+sZj9SnDeAozp4oxz6A7KYftdNAi5yg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 3, 2019 at 2:38 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
> Hi all,
> (Adding Simon as the author of toast_tuple_target, as well Andrew and
> Pavan in CC.)
>
> toast_tuple_target has been introduced in 2017 by c251336 as of v11.
> And while reviewing Pavan's patch to have more complex control over
> the compression threshold of a tuple, I have bumped into some
> surprising code:
> https://www.postgresql.org/message-id/20190403044916.GD3298@paquier.xyz
>
> As far as I understand it, even with this option we don't try to toast
> tuples in heap_prepare_insert() and heap_update() where
> TOAST_TUPLE_THRESHOLD gets used to define if a tuple can be toasted or
> not. The same applies to raw_heap_insert() in rewriteheap.c, and
> needs_toast_table() in toasting.c.
>
> Shouldn't we use the reloption instead of the compiled threshold to
> determine if a tuple should be toasted or not? Perhaps I am missing
> something? It seems to me that this is a bug that should be
> back-patched, but it could also be qualified as a behavior change for
> existing relations.

Could you explain a bit more clearly what you think the bug is?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-04-03 17:07:41 Re: BUG #15383: Join Filter cost estimation problem in 10.5
Previous Message Robert Haas 2019-04-03 16:01:15 Re: pg_basebackup ignores the existing data directory permissions