Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mcMaE-0001Fc-J6 for pgsql-general@arkaria.postgresql.org; Mon, 18 Oct 2021 06:57:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mcMaD-0007Ff-HP for pgsql-general@arkaria.postgresql.org; Mon, 18 Oct 2021 06:57:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mcMaD-0007FV-7x for pgsql-general@lists.postgresql.org; Mon, 18 Oct 2021 06:57:17 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mcMaA-0003vK-MJ for pgsql-general@lists.postgresql.org; Mon, 18 Oct 2021 06:57:16 +0000 Received: by mail-wr1-x432.google.com with SMTP id r10so39307489wra.12 for ; Sun, 17 Oct 2021 23:57:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=AhCfJG2XqTef1rXYaQyx2uRQZ2nYJo1ZybYBE49tB64=; b=JAQOrvFy6rmxAePshTz8wB2WBWTgMenjCLsNgeQSSMhW7Hv1RxWTFZlfgSkJyV2ikO WxJBuNcaz63I13m3qg+eG6CmHcNRgR55oep27JPXS9a5KB875mpz9brM4O4a70JS/3Sw pZkAq8AYDjh0g8puQhy7bmXnp5z0/jyDsN9NcJPXxCOe2PgWE8nP77oJ+hfBNKe65TQt BKzp0ksequWlF07gKc5UaXB0XXHVYWarNBECt4f9a8zdSsEIQVcd45xycwhzDp7Q0CI7 LwCAs3P0uzmeIBKYXl7O+zeStYtx66pnTRHDXi3GwV+XihoJdK+lsif1XsH+ILB+GqMj 5S1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=AhCfJG2XqTef1rXYaQyx2uRQZ2nYJo1ZybYBE49tB64=; b=bNs1+K+aTujKq5IfGWJVpFiafbhQHvdZvtKqsAy77qdRrjTKDbgRYF77lvihtCisOJ 6t2rym1RdVeX7owPeyUDpG56cOkQ79mLMP1Z3Xr+U2Zsn1AJZQHmcoDe1hHLrGPzA1/n jMmO0HflXLGlgqatIfG8BDt5zUb7jZLzLqpP/iUnEQdQ0L8SotKIh7TxlP+OD7YlhSa0 aBE6naIO7IHn1ymdCmiUvVJ8+V0sXaCT+8EkliJ79G7eR99bm5Wpd2wb/dWb84vWHiH8 t4Un7ezZM7YtSTgOO1Br/LPIbaJZLTpNmR22MDYr3kfqM2TgD/DiZu21ivllhYERVjCL Ebcg== X-Gm-Message-State: AOAM530nJGBjNrO+YhsdvbRVrzksLUn7qXw0vYpborW2qRP9jqOouO7g 37/uYKp7HL6BU9MV+Kihx8k= X-Google-Smtp-Source: ABdhPJyh1tbF9DfP4OZEVWKd6dD5c/Nwe1RuLRsepd4QFxk/e4EzaOH4wFucQx2RV7YV7rdwOHFvvQ== X-Received: by 2002:a5d:6b88:: with SMTP id n8mr32514339wrx.332.1634540233198; Sun, 17 Oct 2021 23:57:13 -0700 (PDT) Received: from smtpclient.apple (ppp-94-66-221-255.home.otenet.gr. [94.66.221.255]) by smtp.gmail.com with ESMTPSA id h1sm11287262wmb.7.2021.10.17.23.57.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Oct 2021 23:57:12 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: Force re-compression with lz4 From: Florents Tselai In-Reply-To: Date: Mon, 18 Oct 2021 09:57:11 +0300 Cc: Adrian Klaver , Magnus Hagander , pgsql-general , Ron Content-Transfer-Encoding: quoted-printable Message-Id: <41762F5E-ED52-4F39-9C86-46D75F125F55@gmail.com> References: <08686473-CF87-4B7B-80D1-71B0FA97C1E5@gmail.com> To: Michael Paquier X-Mailer: Apple Mail (2.3654.120.0.1.13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Oh, that=E2=80=99s good to know then. So besides ALTER COMPRESSION for = future inserts there=E2=80=99s not much one can do for pre-existing = values I think it makes sense to update/ add more info to the docs on this as = well, since other people in the thread expected this to work that way = too. Maybe at some point, even allow an explicit option to be defined during = VACUUM ?=20 > On 18 Oct 2021, at 8:18 AM, Michael Paquier = wrote: >=20 > On Sun, Oct 17, 2021 at 10:13:48PM +0300, Florents Tselai wrote: >> I did look into VACUUM(full) for it=E2=80=99s 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. >=20 > 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: > =3D# CREATE TABLE cmdata(f1 text COMPRESSION pglz); > CREATE TABLE > =3D# INSERT INTO cmdata VALUES(repeat('1234567890', 1000)); > INSERT 0 1 > =3D# SELECT pg_column_compression(f1) FROM cmdata; > pg_column_compression > ----------------------- > pglz > (1 row) > =3D# ALTER TABLE cmdata ALTER COLUMN f1 SET COMPRESSION lz4; > ALTER TABLE > =3D# VACUUM FULL cmdata; > VACUUM > =3D# SELECT pg_column_compression(f1) FROM cmdata; > pg_column_compression > ----------------------- > pglz > (1 row) > -- > Michael