From debb1e60a46fc2c0badb42ba66e4fb3d6e4188e2 Mon Sep 17 00:00:00 2001 From: Emmie Maeda Date: Sun, 14 Jan 2024 16:34:05 -0500 Subject: [PATCH] Set default compression as the superior lz4 algorithm. This one is faster and achieves better compression than pglz, but is only available in PostgreSQL starting in version 14 (which isn't a concern for us since we'll be using latest stable to start with.) --- deepwell/migrations/20220906103252_deepwell.sql | 2 +- install/files/postgres/init/02-seed.sql | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/deepwell/migrations/20220906103252_deepwell.sql b/deepwell/migrations/20220906103252_deepwell.sql index cd8ab3809e..88c846adf3 100644 --- a/deepwell/migrations/20220906103252_deepwell.sql +++ b/deepwell/migrations/20220906103252_deepwell.sql @@ -234,7 +234,7 @@ CREATE TYPE page_revision_change AS ENUM ( -- but since we can't we'll just verify the hash length. CREATE TABLE text ( hash BYTEA PRIMARY KEY, - contents TEXT COMPRESSION pglz NOT NULL, + contents TEXT NOT NULL, CHECK (length(hash) = 16) -- KangarooTwelve hash size, 128 bits ); diff --git a/install/files/postgres/init/02-seed.sql b/install/files/postgres/init/02-seed.sql index 3938642aaf..001a6ea93a 100644 --- a/install/files/postgres/init/02-seed.sql +++ b/install/files/postgres/init/02-seed.sql @@ -9,6 +9,7 @@ SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; +SET default_toast_compression=lz4; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false;