Skip to content

Commit

Permalink
MDEV-11371 - column compression
Browse files Browse the repository at this point in the history
Storage engine independent support for column compression.

TINYBLOB, BLOB, MEDIUMBLOB, LONGBLOB, TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT,
VARCHAR and VARBINARY columns can be compressed.

New COMPRESSED column attribute added:
COMPRESSED[=<compression_method>]

System variables added:
column_compression_threshold
column_compression_zlib_level
column_compression_zlib_strategy
column_compression_zlib_wrap

Status variables added:
Column_compressions
Column_decompressions

Limitations:
- the only supported method currently is zlib
- CSV storage engine stores data uncompressed on-disk even if COMPRESSED
  attribute is present
- it is not possible to create indexes over compressed columns.
  • Loading branch information
svoj committed Aug 31, 2017
1 parent dd4e9cd commit fdc4779
Show file tree
Hide file tree
Showing 32 changed files with 2,648 additions and 151 deletions.
2 changes: 2 additions & 0 deletions include/mysql.h.pp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
MYSQL_TYPE_TIMESTAMP2,
MYSQL_TYPE_DATETIME2,
MYSQL_TYPE_TIME2,
MYSQL_TYPE_BLOB_COMPRESSED= 140,
MYSQL_TYPE_VARCHAR_COMPRESSED= 141,
MYSQL_TYPE_NEWDECIMAL=246,
MYSQL_TYPE_ENUM=247,
MYSQL_TYPE_SET=248,
Expand Down
5 changes: 4 additions & 1 deletion include/mysql_com.h
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,10 @@ enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
MYSQL_TYPE_TIMESTAMP2,
MYSQL_TYPE_DATETIME2,
MYSQL_TYPE_TIME2,

/* Compressed types are only used internally for RBR. */
MYSQL_TYPE_BLOB_COMPRESSED= 140,
MYSQL_TYPE_VARCHAR_COMPRESSED= 141,

MYSQL_TYPE_NEWDECIMAL=246,
MYSQL_TYPE_ENUM=247,
MYSQL_TYPE_SET=248,
Expand Down
2 changes: 1 addition & 1 deletion libmariadb
2 changes: 1 addition & 1 deletion libmysqld/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
../sql-common/my_user.c ../sql-common/pack.c
../sql-common/client_plugin.c ../sql-common/mysql_async.c
../sql/password.c ../sql/discover.cc ../sql/derror.cc
../sql/field.cc ../sql/field_conv.cc
../sql/field.cc ../sql/field_conv.cc ../sql/field_comp.cc
../sql/filesort_utils.cc ../sql/sql_digest.cc
../sql/filesort.cc ../sql/gstream.cc ../sql/slave.cc
../sql/signal_handler.cc
Expand Down
Loading

0 comments on commit fdc4779

Please sign in to comment.