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 1mc7pq-0000DG-Er for pgsql-general@arkaria.postgresql.org; Sun, 17 Oct 2021 15:12:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mc7pp-0004AN-DP for pgsql-general@arkaria.postgresql.org; Sun, 17 Oct 2021 15:12:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mc7pp-00047s-1H for pgsql-general@lists.postgresql.org; Sun, 17 Oct 2021 15:12:25 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mc7pm-0003FS-Kd for pgsql-general@lists.postgresql.org; Sun, 17 Oct 2021 15:12:24 +0000 Received: by mail-ed1-x534.google.com with SMTP id d9so59925733edh.5 for ; Sun, 17 Oct 2021 08:12:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:mime-version:subject:message-id:date:to; bh=TG5yXcrDKPHdh5lWeeUAnA2SGl7Uc0HyXIIh1gTVWCI=; b=OZ2nrLX2EzIOgqyr/2Zb5u6Sfvlg8YAY2I/xBggYOUcjCCssO1Jnai/fTbJooqNeN8 gVpjnDM8d2FGsLdXhIu3YmJhdhf0YM6uz/ShKPqB9ksBF+VwNnijUu+F4XTE7eP04of+ YhoZvdkKdvmjifBSRAr7XKLHSbfbMQFWK65BXncZfBoUVfLUShD5ro6Du25yMxSw8vqD Lh//yJ9V6p9a4K6Dc59N40ZidwiKnXv2hB06sIQJVsR4OSV/cSZZll95Pr48l7oVqAhd SUEZO16JwTIDRjMQv2iSl16D/kCeOO16FL36PNluW5RV/TiVqad2zJxkAPbK+21hQl41 eQyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:mime-version:subject:message-id:date:to; bh=TG5yXcrDKPHdh5lWeeUAnA2SGl7Uc0HyXIIh1gTVWCI=; b=42wfLDGK/UgG6p6SgZBBnCfaj85WicvFOMZ43ewJmwA8OZFTl3vUwWJD3LI7w2NAo2 6Kn3KSZS3QelXRSlrvyDLPDdkQQEWAnnKY0UNAHVs3HqOx0dqJ+M/u7/XCD9eXHsvHeb SvXX5vPHqd53Wt9jt6SlSDHuLxLpWExVw762mdxlZwwA9Itm67bR4cT6zuabkJecdAb6 1paKXyDHsHaqLoV23R65zjm2QfOULd4VSmWshVMwigG797OQp2m4SCyB5Zji7rqr7rty VSUhBDt7PmFYLiVSB5yG33+Wug3i5LtyjGTus4QxfxNzSvf3hLt5IHjpkFw+Z/2S9jFf EbDQ== X-Gm-Message-State: AOAM530hVXUuT58bCvO1HUyWd3XOXptLIVKBDGF1zvrxw24AmQW8DIF4 UvoJH9ej4pqX7ZfgpedpdXZOAG4yqJGxMoT1 X-Google-Smtp-Source: ABdhPJwE9es4qpGjcmn+/gpPNRoXz2ZHbmD5qoEWARDhdntAQGTl8oo2cY6gHFXF5jU/7Y4Dn+htXA== X-Received: by 2002:aa7:dbca:: with SMTP id v10mr36420316edt.280.1634483539754; Sun, 17 Oct 2021 08:12:19 -0700 (PDT) Received: from smtpclient.apple (78-207-14.adsl.cyta.gr. [78.87.207.14]) by smtp.gmail.com with ESMTPSA id w11sm8469019edl.87.2021.10.17.08.12.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Oct 2021 08:12:19 -0700 (PDT) From: Florents Tselai Content-Type: multipart/alternative; boundary="Apple-Mail=_125CA3B6-DCB3-4A0B-A474-3974760AE242" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Force re-compression with lz4 Message-Id: Date: Sun, 17 Oct 2021 18:12:17 +0300 To: pgsql-general@lists.postgresql.org 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 --Apple-Mail=_125CA3B6-DCB3-4A0B-A474-3974760AE242 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hello, I have a table storing mostly text data (40M+ rows) that has = pg_total_relation_size ~670GB. I=E2=80=99ve just upgraded to postgres 14 and I=E2=80=99m now eager to = try the new LZ4 compression. I=E2=80=99ve altered the column to use the new lz4 compression, but that = only applies to new rows. What=E2=80=99s the recommended way of triggering the re-evaluation for = pre-existing rows?=20 I tried wrapping a function like the following, but apparently each old = record retains the compression applied. text_corpus=3D(SELECT t.text from ...); delete from t where id=3D; insert into t(id, text) values (id, text_corpus); Fttb, I resorted to preparing an external shell script to execute = against the db but that=E2=80=99s too slow as it moves data in&out the = db. Is there a smarter way to do this ? Thanks, Flo= --Apple-Mail=_125CA3B6-DCB3-4A0B-A474-3974760AE242 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hello,

I = have a table storing mostly text data (40M+ rows) that has = pg_total_relation_size ~670GB.
I=E2=80=99ve just = upgraded to postgres 14 and I=E2=80=99m now eager to try the new LZ4 = compression.

I=E2=80=99ve altered the column to use the new lz4 = compression, but that only applies to new rows.

What=E2=80=99s the recommended way of = triggering the re-evaluation for pre-existing rows? 

I tried wrapping a = function like the following, but apparently each old record retains the = compression applied.
text_corpus=3D(SELECT t.text from =
...);
delete from t = where = id=3D;

insert into t(id, text) values (id, text_corpus);

Fttb, I resorted to preparing an external shell script to = execute against the db but that=E2=80=99s too slow as it moves data = in&out the db.

Is there a smarter way to do this ?

Thanks,
Flo
= --Apple-Mail=_125CA3B6-DCB3-4A0B-A474-3974760AE242--