Hi, > Overall idea is great. > > I just want to mention LZ4 also have API to use dictionary. Its dictionary > will be as simple as "virtually prepended" text (in contrast to complex > ZStd dictionary format). > > I mean, it would be great if "dictionary" will be common property for > different algorithms. > > On the other hand, zstd have "super fast" mode which is actually a bit > faster than LZ4 and compresses a bit better. So may be support for > different algos is not essential. (But then we need a way to change > compression level to that "super fast" mode.) >
zstd compression level and zstd dictionary size is configurable at attribute level using ALTER TABLE. Default zstd level is 3 and dict size is 4KB. For super fast mode level can be set to 1. ``` test=# alter table zstd alter column doc set compression zstd; ALTER TABLE test=# alter table zstd alter column doc set(zstd_cmp_level = 1); ALTER TABLE test=# select * from pg_attribute where attrelid = 'zstd'::regclass and attname = 'doc'; attrelid | attname | atttypid | attlen | attnum | atttypmod | attndims | attbyval | attalign | attstorage | attcompre ssion | attnotnull | atthasdef | atthasmissing | attidentity | attgenerated | attisdropped | attislocal | attinhcount | attcollation | attstattarget | attacl | attoptions | attfdwoptions | attmissingval ----------+---------+----------+--------+--------+-----------+----------+----------+----------+------------+---------- ------+------------+-----------+---------------+-------------+--------------+--------------+------------+------------- +--------------+---------------+--------+----------------------------------+---------------+--------------- 16389 | doc | 3802 | -1 | 1 | -1 | 0 | f | i | x | z | f | f | f | | | f | t | 0 | 0 | | | {zstd_dictid=1,zstd_cmp_level=1} | | (1 row) ```