Storage-engine independent support for column compression was introduced in MariaDB 10.3.2
Storage-engine independent column compression enables TINYBLOB, BLOB, MEDIUMBLOB, LONGBLOB, TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT, VARCHAR and VARBINARY columns to be compressed.
This is performed by means of a new COMPRESSED column attribute: COMPRESSED[=<compression_method>]
When using the COMPRESSED
attribute, note that FIELD LENGTH is reduced by 1; for example, a BLOB has a length of 65535, while BLOB COMPRESSED has 65535-1. See MDEV-15592.
column_compression_threshold
--column-compression-threshold=#
numeric
100
0
to 4294967295
column_compression_zlib_level
--column-compression-threshold=#
numeric
6
1
to 9
column_compression_zlib_strategy
DEFAULT_STRATEGY
for normal data, FILTERED
for data produced by a filter (or predictor), HUFFMAN_ONLY
to force Huffman encoding only (no string match), or RLE
to limit match distances to one (run-length encoding). Filtered data consists mostly of small values with a somewhat random distribution. In this case, the compression algorithm is tuned to compress them better. The effect of FILTERED
is to force more Huffman coding and less string matching; it is somewhat intermediate between DEFAULT_STRATEGY
and HUFFMAN_ONLY
. RLE
is designed to be almost as fast as HUFFMAN_ONLY
, but give better compression for PNG image data. The strategy parameter only affects the compression ratio but not the correctness of the compressed output even if it is not set appropriately. FIXED
prevents the use of dynamic Huffman codes, allowing for a simpler decoder for special applications. --column-compression-zlib_strategy=#
enum
DEFAULT_STRATEGY
DEFAULT_STRATEGY
, FILTERED
, HUFFMAN_ONLY
, RLE
, FIXED
column_compression_zlib_wrap
1
(0
is default), generate zlib header and trailer and compute adler32 check value. It can be used with storage engines that don't provide data integrity verification to detect data corruption. --column-compression-zlib-wrap{=0|1}
boolean
OFF
Column_compressions
numeric
Column_decompressions
numeric
CREATE TABLE cmp (i TEXT COMPRESSED); CREATE TABLE cmp2 (i TEXT COMPRESSED=zlib);
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/storage-engine-independent-column-compression/