From df4ad6daca8e7b4cd16e8d3f52ea0d7517f85a93 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 16 Oct 2018 01:25:02 -0700 Subject: [PATCH] ircd::db: Column table options package post rocksdb v5.15 upgrade. --- ircd/db.cc | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/ircd/db.cc b/ircd/db.cc index 15860fc30..8a5a74fd8 100644 --- a/ircd/db.cc +++ b/ircd/db.cc @@ -1429,11 +1429,23 @@ ircd::db::database::column::column(database *const &d, // Block based table index type. table_opts.index_type = rocksdb::BlockBasedTableOptions::kTwoLevelIndexSearch; + table_opts.enable_index_compression = false; table_opts.partition_filters = true; + // Specify that index blocks should use the cache. If not, they will be + // pre-read into RAM by rocksdb internally. Because of the above + // TwoLevelIndex + partition_filters configuration on RocksDB v5.15 it's + // better to use pre-read except in the case of a massive database. No + // known deployments which exceed partitioned pre-read exist so these + // settings are unconditionally false. + table_opts.cache_index_and_filter_blocks = false; + table_opts.cache_index_and_filter_blocks_with_high_priority = false; + table_opts.pin_top_level_index_and_filter = false; + table_opts.pin_l0_filter_and_index_blocks_in_cache = false; + // Setup the block size - table_opts.block_size = this->descriptor.block_size; table_opts.metadata_block_size = 512; + table_opts.block_size = this->descriptor.block_size; // Setup the cache for assets. const auto &cache_size(this->descriptor.cache_size); @@ -1453,11 +1465,6 @@ ircd::db::database::column::column(database *const &d, // Tickers::READ_AMP_TOTAL_READ_BYTES / Tickers::READ_AMP_ESTIMATE_USEFUL_BYTES //table_opts.read_amp_bytes_per_bit = 8; - // Specify that index blocks should use the cache. If not, they will be read into - // RAM by rocksdb internally which is bad for a large db and/or small block sizes. - table_opts.cache_index_and_filter_blocks = true; - table_opts.cache_index_and_filter_blocks_with_high_priority = true; - // Finally set the table options in the column options. this->options.table_factory.reset(rocksdb::NewBlockBasedTableFactory(table_opts));