From: Michael Paquier <michael@paquier.xyz>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: kg.postgresql@olympiakos.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #17513: recompressing already-compressed data via VACUUM FULL or CLUSTER does not work
Date: Thu, 9 Jun 2022 10:10:52 +0900
Message-ID: <YqFInCwQCvMAg3/+@paquier.xyz> (raw)
In-Reply-To: <CAKFQuwbbDcA8=sXYU6scDG3gZzaXjaz0pCNJoEpE-G4ZCd3Wsg@mail.gmail.com>
References: <17513-fe70a8ef15de3e76@postgresql.org>
<CAKFQuwbbDcA8=sXYU6scDG3gZzaXjaz0pCNJoEpE-G4ZCd3Wsg@mail.gmail.com>
On Wed, Jun 08, 2022 at 03:59:51PM -0700, David G. Johnston wrote:
> The described behavior didn't even make it into 14.0; and I have no clue
> where such a thing would be documented to guess if the lack was intentional
> or not. I can confirm that as of today the behavior in HEAD is to not
> decompress and recompress during rewrite. Frankly, this seems like the
> expected behavior absent any documentation to the contrary. Whether there
> is a use case for someone to code up a way to get a recompression to happen
> is another matter. Oddly, I kinda expected that "update cmdata set f1 =
> f1;" might do it but alas it does not (...set f1 = f1 || ''... works; I'm
> not quite sure how much worse that, immediately followed by vacuum full,
> would be compared to whatever it would take to do it all during the full
> vacuum...especially if one is changing every single row on the table).
See commit dbab0c0 about the reasons of this choice, with this thread:
https://www.postgresql.org/message-id/20210527003144.xxqppojoiwurc2iz@alap3.anarazel.de
The docs of ALTER TABLE .. SET COMPRESSION include a note on the
matter: https://www.postgresql.org/docs/14/sql-altertable.html
"This does not cause the table to be rewritten, so existing data may
still be compressed with other compression methods."
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
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-bugs@postgresql.org
Cc: michael@paquier.xyz, david.g.johnston@gmail.com
Subject: Re: BUG #17513: recompressing already-compressed data via VACUUM FULL or CLUSTER does not work
In-Reply-To: <YqFInCwQCvMAg3/+@paquier.xyz>
References: <17513-fe70a8ef15de3e76@postgresql.org> <CAKFQuwbbDcA8=sXYU6scDG3gZzaXjaz0pCNJoEpE-G4ZCd3Wsg@mail.gmail.com> <YqFInCwQCvMAg3/+@paquier.xyz>
* 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