pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: rob stone <floriparob@tpg.com.au>
To: Michael Paquier <michael@paquier.xyz>
To: Dominique Devienne <ddevienne@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: How to force "re-TOAST" after changing STORAGE or COMPRESSION?
Date: Tue, 03 Oct 2023 12:33:54 +1100
Message-ID: <069c100e455299d6e1aa80bda283a397fadf1926.camel@tpg.com.au> (raw)
In-Reply-To: <ZRtY5lEDPlSQuore@paquier.xyz>
References: <CAFCRh-8_EFUgKSNpsyideokDo+j80iPg4GVwNoukniOjpZVnng@mail.gmail.com>
	<ZRtY5lEDPlSQuore@paquier.xyz>

Hello,

On Tue, 2023-10-03 at 08:57 +0900, Michael Paquier wrote:
> On Mon, Oct 02, 2023 at 04:42:15PM +0200, Dominique Devienne wrote:
> > According to the doc, the table is NOT changed.
> > In my case, I DO want to have the bytea column rewritten
> > according to the new STORAGE and/or COMPRESSION.
> > The doc doesn't mention how to achieve that.
> 
> Yes, the compression type of the existed toasted values are not
> changed after an ALTER SET, and that's not something one would do on
> a
> daily basis, either.
> 
> > VACUUM?
> > VACUUM FULL?
> > Else?
> 
> VACUUM was considered as an option to force a rewrte, but it has been
> removed because we were not sure that this is the correct path to do
> so or that in some cases forcing the hand of the user was incorrect.
> It was also creating a penalty in some of the hot loops of area:
> commit: dbab0c07e5ba1f19a991da2d72972a8fe9a41bda
> committer: Michael Paquier <michael@paquier.xyz>
> date: Mon, 14 Jun 2021 09:25:50 +0900
> Remove forced toast recompression in VACUUM FULL/CLUSTER
> 
> Related thread:
> https://postgr.es/m/20210527003144.xxqppojoiwurc2iz@alap3.anarazel.de
> --
> Michael


Would running CLUSTER on the table use the new parameters for the re-
write?

The docs about CLUSTER do not mention anything about toast'ed data. If
the toast data is huge it would be held in a separate file on disk. If
the toast column is being compressed, and its size is now less than the
value used as to whether a separate file is required or not, will the
outcome be a single row for the re-write and deletion of the "old"
toast'ed entry?

Robert






view thread (9+ messages)  latest in thread

Message-ID: <069c100e455299d6e1aa80bda283a397fadf1926.camel@tpg.com.au>
Permalink:  ../069c100e455299d6e1aa80bda283a397fadf1926.camel@tpg.com.au/
Also on:    postgresql.org/message-id/069c100e455299d6e1aa80bda283a397fadf1926.camel@tpg.com.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: floriparob@tpg.com.au, michael@paquier.xyz, ddevienne@gmail.com
  Subject: Re: How to force "re-TOAST" after changing STORAGE or COMPRESSION?
  In-Reply-To: <069c100e455299d6e1aa80bda283a397fadf1926.camel@tpg.com.au>
  References: <CAFCRh-8_EFUgKSNpsyideokDo+j80iPg4GVwNoukniOjpZVnng@mail.gmail.com> <ZRtY5lEDPlSQuore@paquier.xyz> <069c100e455299d6e1aa80bda283a397fadf1926.camel@tpg.com.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox