From 0a0fad447bc46bb7169f4ca86d5942f2a445a5ed Mon Sep 17 00:00:00 2001 From: Andrew Kryczka Date: Mon, 12 Feb 2018 14:54:50 -0800 Subject: [PATCH] db_bench separate options for partition index and filters Summary: Some workloads (like my current benchmarking) may want partitioned indexes without partitioned filters. Particularly, when `-optimize_filters_for_hits=true`, the total index size may be larger than the total filter size, so it can make sense to hold all filters in-memory but not all indexes. Closes https://github.com/facebook/rocksdb/pull/3492 Differential Revision: D6970092 Pulled By: ajkr fbshipit-source-id: b7fa1828e1d13829339aefb90fd56eb7c5337f61 --- tools/db_bench_tool.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 38f731690..748ce57a9 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -412,6 +412,8 @@ DEFINE_bool(cache_index_and_filter_blocks, false, DEFINE_bool(partition_index_and_filters, false, "Partition index and filter blocks."); +DEFINE_bool(partition_index, false, "Partition index blocks"); + DEFINE_int64(metadata_block_size, rocksdb::BlockBasedTableOptions().metadata_block_size, "Max partition size when partitioning index/filters"); @@ -3096,16 +3098,18 @@ void VerifyDBFromDB(std::string& truth_db_name) { } else { block_based_options.index_type = BlockBasedTableOptions::kBinarySearch; } - if (FLAGS_partition_index_and_filters) { + if (FLAGS_partition_index_and_filters || FLAGS_partition_index) { if (FLAGS_use_hash_search) { fprintf(stderr, "use_hash_search is incompatible with " - "partition_index_and_filters and is ignored"); + "partition index and is ignored"); } block_based_options.index_type = BlockBasedTableOptions::kTwoLevelIndexSearch; - block_based_options.partition_filters = true; block_based_options.metadata_block_size = FLAGS_metadata_block_size; + if (FLAGS_partition_index_and_filters) { + block_based_options.partition_filters = true; + } } if (cache_ == nullptr) { block_based_options.no_block_cache = true;