diff --git a/db/db_test2.cc b/db/db_test2.cc index 8fdcfda2c0..ccbed04979 100644 --- a/db/db_test2.cc +++ b/db/db_test2.cc @@ -2216,6 +2216,18 @@ TEST_F(DBTest2, ManualCompactionOverlapManualCompaction) { rocksdb::SyncPoint::GetInstance()->DisableProcessing(); } + +TEST_F(DBTest2, OptimizeForPointLookup) { + Options options = CurrentOptions(); + Close(); + options.OptimizeForPointLookup(2); + ASSERT_OK(DB::Open(options, dbname_, &db_)); + + ASSERT_OK(Put("foo", "v1")); + ASSERT_EQ("v1", Get("foo")); + Flush(); + ASSERT_EQ("v1", Get("foo")); +} #endif // ROCKSDB_LITE } // namespace rocksdb diff --git a/util/options.cc b/util/options.cc index 34df0ca891..839fc19164 100644 --- a/util/options.cc +++ b/util/options.cc @@ -700,7 +700,7 @@ ColumnFamilyOptions* ColumnFamilyOptions::OptimizeForPointLookup( block_based_options.block_cache = NewLRUCache(static_cast(block_cache_size_mb * 1024 * 1024)); table_factory.reset(new BlockBasedTableFactory(block_based_options)); - memtable_factory.reset(NewHashLinkListRepFactory()); + memtable_prefix_bloom_size_ratio = 0.02; return this; }