rocksdb/options
Peter Dillinger 57f3032285 Allow fractional bits/key in BloomFilterPolicy (#6092)
Summary:
There's no technological impediment to allowing the Bloom
filter bits/key to be non-integer (fractional/decimal) values, and it
provides finer control over the memory vs. accuracy trade-off. This is
especially handy in using the format_version=5 Bloom filter in place
of the old one, because bits_per_key=9.55 provides the same accuracy as
the old bits_per_key=10.

This change not only requires refining the logic for choosing the best
num_probes for a given bits/key setting, it revealed a flaw in that logic.
As bits/key gets higher, the best num_probes for a cache-local Bloom
filter is closer to bpk / 2 than to bpk * 0.69, the best choice for a
standard Bloom filter. For example, at 16 bits per key, the best
num_probes is 9 (FP rate = 0.0843%) not 11 (FP rate = 0.0884%).
This change fixes and refines that logic (for the format_version=5
Bloom filter only, just in case) based on empirical tests to find
accuracy inflection points between each num_probes.

Although bits_per_key is now specified as a double, the new Bloom
filter converts/rounds this to "millibits / key" for predictable/precise
internal computations. Just in case of unforeseen compatibility
issues, we round to the nearest whole number bits / key for the
legacy Bloom filter, so as not to unlock new behaviors for it.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6092

Test Plan: unit tests included

Differential Revision: D18711313

Pulled By: pdillinger

fbshipit-source-id: 1aa73295f152a995328cb846ef9157ae8a05522a
2019-11-26 15:59:34 -08:00
..
cf_options.cc Apply formatter to recent 200+ commits. (#5830) 2019-09-20 12:04:26 -07:00
cf_options.h Remove unused/undefined ImmutableCFOptions() (#6086) 2019-11-26 13:28:31 -08:00
db_options.cc Option to make write group size configurable (#5759) 2019-09-11 18:28:33 -07:00
db_options.h Option to make write group size configurable (#5759) 2019-09-11 18:28:33 -07:00
options_helper.cc Remove snap_refresh_nanos option (#5826) 2019-09-18 20:26:04 -07:00
options_helper.h Option string/map/file can set env from object registry (#5237) 2019-04-25 11:35:09 -07:00
options_parser.cc Divide file_reader_writer.h and .cc (#5803) 2019-09-16 10:33:51 -07:00
options_parser.h Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
options_sanity_check.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
options_sanity_check.h Change RocksDB License 2017-07-15 16:11:23 -07:00
options_settable_test.cc Apply formatter on recent 45 commits. (#5827) 2019-09-19 12:34:17 -07:00
options_test.cc Allow fractional bits/key in BloomFilterPolicy (#6092) 2019-11-26 15:59:34 -08:00
options.cc Remove snap_refresh_nanos option (#5826) 2019-09-18 20:26:04 -07:00