Re: Useless toast - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Useless toast
Date
Msg-id 9360d852-7630-4e43-8303-72c5d818fa4f@eisentraut.org
Whole thread Raw
In response to Useless toast  (Marcos Pegoraro <marcos@f10.com.br>)
Responses Re: Useless toast
List 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.




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [18] Policy on IMMUTABLE functions and Unicode updates
Next
From: Tom Lane
Date:
Subject: Re: Useless toast