Re: Force re-compression with lz4 - Mailing list pgsql-general

From Michael Paquier
Subject Re: Force re-compression with lz4
Date
Msg-id YW0DklWY+K3ocQA2@paquier.xyz
Whole thread Raw
In response to Re: Force re-compression with lz4  (Florents Tselai <florents.tselai@gmail.com>)
Responses Re: Force re-compression with lz4
Re: Force re-compression with lz4
List pgsql-general
On Sun, Oct 17, 2021 at 10:13:48PM +0300, Florents Tselai wrote:
> I did look into VACUUM(full) for it’s PROCESS_TOAST option which
> makes sense, but the thing is I already had a cron-ed VACUUM (full)
> which I ended up disabling a while back; exactly because of the
> double-space requirement.

Please note that VACUUM FULL does not enforce a recompression on
existing values.  See commit dbab0c0, that disabled this choice as it
introduced a noticeable performance penality in some cases when
looking at the compression type of the vacuumed table attributes:
=# CREATE TABLE cmdata(f1 text COMPRESSION pglz);
CREATE TABLE
=# INSERT INTO cmdata VALUES(repeat('1234567890', 1000));
INSERT 0 1
=# SELECT pg_column_compression(f1) FROM cmdata;
 pg_column_compression
-----------------------
  pglz
(1 row)
=# ALTER TABLE cmdata ALTER COLUMN f1 SET COMPRESSION lz4;
ALTER TABLE
=# VACUUM FULL cmdata;
VACUUM
=# SELECT pg_column_compression(f1) FROM cmdata;
 pg_column_compression
-----------------------
  pglz
(1 row)
--
Michael

Attachment

pgsql-general by date:

Previous
From: "Daniel Verite"
Date:
Subject: Re: Force re-compression with lz4
Next
From: Francisco Olarte
Date:
Subject: Re: Force re-compression with lz4