LZ4 compression on RDS Postgres 14
Does Postgres 14 on RDS support TOAST compression using LZ4?
https://www.postgresql.org/docs/14/runtime-config-client.html#GUC-DEFAULT-TOAST-COMPRESSION
Verified lz4 is available.
- created RDS for PostgreSQL 14.1 instance
- SHOW default_toast_compression; returned pglz
- CREATE TABLE TESTLZ4(COL_1 text COMPRESSION lz4);
- INSERT INTO TESTLZ4 VALUES (repeat('123456789', 1000));
- SELECT pg_column_compression(COL_1) FROM TESTLZ4; retured 'lz4'
- SET default_toast_compression TO lz4;
- SHOW default_toast_compression; returned lz4
Amazon Relational Database Service (Amazon RDS) for PostgreSQL does not have database wide compression. For variable length datatypes(text, varchar), RDS for PostgreSQL has TOAST (The oversized attribute storage technique) storage. TOAST by default uses pglz compression. Now with RDS for PostgreSQL 14 you can also use lz4 compression. The transparent compression handled by TOAST, and the option for compression in CREATE/ALTER TABLE are the extent of compression options in RDS for PostgreSQL.
Most of this type of information is also available via the pg_config view. -- on RDS Postgres 14.1 you can see --with-lz4 in the configure info.
postgres=> select name,setting from pg_config where name ilike 'configure';
name | setting
-----------+-------------------------------------------------------------------------------------------------------------------------------------------
CONFIGURE | '--prefix=/rdsdbbin/postgres-14.1.R1' '--with-openssl' '--with-perl' '--with-tcl' '--with-ossp-uuid' '--with-libxml' '--with-pam' '--with-ldap' '--with-krb-srvnam=whatever' '--with-gssapi' '--with-libraries=/rdsdbbin/postgres-14.1.R1/lib' '--with-includes=/rdsdbbin/postgres-14.1.R1/include' '--enable-debug' '--with-llvm' 'LLVM_CONFIG=/build/llvm/bin/llvm-config' '--with-icu' 'ICU_CFLAGS=-I/rdsdbbin/postgres-14.1.R1/include -DU_STATIC_IMPLEMENTATION' '--with-lz4' 'ICU_LIBS=-L/rdsdbbin/postgres-14.1.R1/lib -licui18n -licuuc -licudata -lstdc++'
(1 row)
Relevant questions
XA Global Transaction Support for Aurora Postgres
asked 3 months agodoes AWS DMS support partition tables from postgres
asked 5 months agoLZ4 compression on RDS Postgres 14
Accepted Answerasked 3 months agoRDS Database Instance does not show up in dropdown when creating RDS Proxy
asked 3 months agoFATAL: password authentication failed for user "postgres
asked 4 years agoHeterogeneous database links on AWS RDS
Accepted Answerasked a year agoHow to create SSL dblink connection from RDS to postgres on premise?
asked 4 months agoHow to restrict database users for RDS Postgres using AWS Managed AD trusted with customer on-prem AD
Accepted Answerasked 2 years agoDeploying PostgreSQL 10.14
asked 20 days ago60K updates to RDS Postgres - performance challenge
Accepted Answerasked 2 years ago
Thank you, but I'm aware of all that. I'm specifically asking whether the version of Postgres 14 that's running on RDS was compiled with LZ4 support, which is why I linked to the Postgres doc page that explains this.