rocksdb/tools
Lei Jin 0f2d768191 hints for narrowing down FindFile range and avoiding checking unrelevant L0 files
Summary:
The file tree structure in Version is prebuilt and the range of each file is known.
On the Get() code path, we do binary search in FindFile() by comparing
target key with each file's largest key and also check the range for each L0 file.
With some pre-calculated knowledge, each key comparision that has been done can serve
as a hint to narrow down further searches:
(1) If a key falls within a L0 file's range, we can safely skip the next
file if its range does not overlap with the current one.
(2) If a key falls within a file's range in level L0 - Ln-1, we should only
need to binary search in the next level for files that overlap with the current one.

(1) will be able to skip some files depending one the key distribution.
(2) can greatly reduce the range of binary search, especially for bottom
levels, given that one file most likely only overlaps with N files from
the level below (where N is max_bytes_for_level_multiplier). So on level
L, we will only look at ~N files instead of N^L files.

Some inital results: measured with 500M key DB, when write is light (10k/s = 1.2M/s), this
improves QPS ~7% on top of blocked bloom. When write is heavier (80k/s =
9.6M/s), it gives us ~13% improvement.

Test Plan: make all check

Reviewers: haobo, igor, dhruba, sdong, yhchiang

Reviewed By: haobo

CC: leveldb

Differential Revision: https://reviews.facebook.net/D17205
2014-04-21 09:10:12 -07:00
..
auto_sanity_test.sh Add script auto_sanity_test.sh to perform auto sanity test 2014-04-03 10:21:46 -07:00
blob_store_bench.cc Turn on -Wmissing-prototypes 2014-04-09 21:17:14 -07:00
db_crashtest2.py Merge branch 'master' into columnfamilies 2014-03-20 14:41:37 -07:00
db_crashtest.py Merge branch 'master' into columnfamilies 2014-03-20 14:41:37 -07:00
db_repl_stress.cc Revert "Fix bad merge of D16791 and D16767" 2014-03-12 09:37:43 -07:00
db_sanity_test.cc Turn on -Wmissing-prototypes 2014-04-09 21:17:14 -07:00
db_stress.cc hints for narrowing down FindFile range and avoiding checking unrelevant L0 files 2014-04-21 09:10:12 -07:00
ldb_test.py Consistency Check Function 2014-03-20 13:42:45 -07:00
ldb.cc Revert "Don't compile ldb tool into static library" 2014-04-15 11:29:02 -07:00
reduce_levels_test.cc Revert "Fix sst_dump and reduce_levels_test compile errors" 2014-04-15 11:28:52 -07:00
sst_dump.cc Revert "Fix sst_dump and reduce_levels_test compile errors" 2014-04-15 11:28:52 -07:00