Re: Useless toast

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Marcos Pegoraro <marcos(at)f10(dot)com(dot)br>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Useless toast
Date: 2024-07-23 19:39:40
Message-ID: 9360d852-7630-4e43-8303-72c5d818fa4f@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 23.07.24 20:35, Marcos Pegoraro wrote:
> Using version 16, seems strange when toast needs to be created.
> Tested with domain being numeric or varchar(10) with the same results.
>
> And If that domain is integer then no toast is created.
>
> I think none of these tables should have a toast, right ?

The mechanism that determines whether a toast table is needed only
considers the data type, not the "typmod" (arguments of the data type).
So this is perhaps suboptimal, but this logic just doesn't exist.

Also, note that varchar(10) means 10 characters, not 10 bytes, so you
can't necessarily draw conclusions about storage size from that. There
aren't any supported character encodings that would encode 10 characters
into more bytes than the toast threshold, so this is just theoretical,
but it would be hard to decide what the actual threshold would be in
practice.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-07-23 19:40:18 Re: Useless toast
Previous Message Tom Lane 2024-07-23 19:26:55 Re: [18] Policy on IMMUTABLE functions and Unicode updates