MariaDB starting with
Compressions plugins were added in a preview release.
The various MariaDB storage engines, such as InnoDB, RocksDB, Mroonga, can use different compression libraries.
Before , each separate library would have to be compiled in order to be available for use, resulting in numerous runtime/rpm/deb dependencies, most of which would never be used by users.
From , five additional MariaDB compression libraries (besides the default zlib) are available as plugins (note that these affect InnoDB and Mroonga only; RocksDB still uses the compression algorithms from its own library):
bzip2
lzma
lz4
lzo
snappy
Depending on how MariaDB was installed, the libraries may already be available for installation, or may first need to be installed as .deb or .rpm packages, for example:
Once available, , for example:
The compression algorithm can then be used, for example, in :
When upgrading from a release without compression plugins, if a non-zlib compression algorithm was used, those tables will be unreadable until the appropriate compression library is installed. should be run. The --force option (to run ) or mariadb-check itself will indicate any problems with compression, for example:
or
In this case, the appropriate compression plugin should be installed, and the server restarted.
(mariadb.org blog)
Add zstd as a compression plugin -
This page is licensed: CC BY-SA / Gnu FDL
apt-get install mariadb-plugin-provider-lz4INSTALL SONAME 'provider_lz4';SET GLOBAL innodb_compression_algorithm = lz4;Warning : MariaDB tried to use the LZMA compression, but its provider plugin is not loaded
Error : Table 'test.t' doesn't exist in engine
status : Operation failedError : Table test/t is compressed with lzma, which is not currently loaded.
Please load the lzma provider plugin to open the table
error : Corrupt