diff --git a/ircd/db.cc b/ircd/db.cc index 1ee14d5cb..d8c960a84 100644 --- a/ircd/db.cc +++ b/ircd/db.cc @@ -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 //