0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-17 15:30:52 +01:00

ircd::db: Improve compression options; bottommost LZ4HC.

This commit is contained in:
Jason Volk 2020-09-19 06:46:59 -07:00
parent 03dba64f0b
commit 358008e8e7

View file

@ -2069,18 +2069,6 @@ ircd::db::database::column::column(database &d,
// Set filter reductions for this column. This means we expect a key to exist.
this->options.optimize_filters_for_hits = this->descriptor->expect_queries_hit;
// Compression type
this->options.compression = find_supported_compression(this->descriptor->compression);
//this->options.compression = rocksdb::kNoCompression;
// Compression options
this->options.compression_opts.enabled = true;
this->options.compression_opts.max_dict_bytes = 0;//8_MiB;
// Mimic the above for bottommost compression.
//this->options.bottommost_compression = this->options.compression;
//this->options.bottommost_compression_opts = this->options.compression_opts;
//TODO: descriptor / conf
static const auto write_buffer_blocks {4096L};
static const long write_buffer_size_minmax[]
@ -2176,6 +2164,39 @@ ircd::db::database::column::column(database &d,
this->options.periodic_compaction_seconds = this->descriptor->compaction_period.count();
#endif
// Compression type
this->options.compression = find_supported_compression(this->descriptor->compression);
//this->options.compression = rocksdb::kNoCompression;
// Specify compression type per level
this->options.compression_per_level =
{
// 0: uncompressed unsorted
rocksdb::kNoCompression,
// 1: uncompressed sorted
rocksdb::kNoCompression,
// 2, 3, 4: compressed sorted
this->options.compression,
this->options.compression,
this->options.compression,
this->options.compression,
// 6: highly compressed sorted
this->options.compression == rocksdb::kLZ4Compression?
rocksdb::kLZ4HCCompression:
this->options.compression,
};
// Compression options
this->options.compression_opts.enabled = true;
this->options.compression_opts.max_dict_bytes = 0;//8_MiB;
// Bottommost compression
this->options.bottommost_compression = this->options.compression_per_level.back();
this->options.bottommost_compression_opts = this->options.compression_opts;
//
// Table options
//