LZ4 compression/decompression UDF for MySQL
SELECT LENGTH(LZ4_COMPRESS(REPEAT('0', 1024 * 1024)))
+------------------------------------------------+
| LENGTH(LZ4_COMPRESS(REPEAT('0', 1024 * 1024))) |
+------------------------------------------------+
| 4122 |
+------------------------------------------------+
SELECT LENGTH(LZ4_DECOMPRESS(LZ4_COMPRESS(REPEAT('0', 1024 * 1024))))
+----------------------------------------------------------------+
| LENGTH(LZ4_DECOMPRESS(LZ4_COMPRESS(REPEAT('0', 1024 * 1024)))) |
+----------------------------------------------------------------+
| 1048576 |
+----------------------------------------------------------------+
Build and install plugin
% make
# make install
Import functions
CREATE FUNCTION LZ4_COMPRESS RETURNS STRING SONAME 'mysql-lz4.so';
CREATE FUNCTION LZ4_DECOMPRESS RETURNS STRING SONAME 'mysql-lz4.so';