Re: BUG #17513: recompressing already-compressed data via VACUUM FULL or CLUSTER does not work

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: kg(dot)postgresql(at)olympiakos(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17513: recompressing already-compressed data via VACUUM FULL or CLUSTER does not work
Date: 2022-06-08 22:59:51
Message-ID: CAKFQuwbbDcA8=sXYU6scDG3gZzaXjaz0pCNJoEpE-G4ZCd3Wsg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Jun 8, 2022 at 12:46 PM PG Bug reporting form <
noreply(at)postgresql(dot)org> wrote:

> The following bug has been logged on the website:
>
> Bug reference: 17513
> Logged by: Kiriakos Georgiou
> Email address: kg(dot)postgresql(at)olympiakos(dot)com
> PostgreSQL version: 14.3
> Operating system: Linux
> Description:
>
> Per
>
> https://www.postgresql.org/message-id/E1lNKw9-0008DT-1L%40gemulon.postgresql.org
> and https://www.enterprisedb.com/blog/configurable-lz4-toast-compression
> if you change a column's compression algorithm and run VACUUM FULL or
> CLUSTER, the data will be recompressed with the new compression algorithm.
> This is does not work for 14.2 and 14.3 (the only two versions I tested).
>

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).

David J.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2022-06-09 01:10:52 Re: BUG #17513: recompressing already-compressed data via VACUUM FULL or CLUSTER does not work
Previous Message Aleš Zelený 2022-06-08 20:11:12 Re: BUG #17512: Process running query fails with SIGSEV - nodeMemoize.c:349