rocksdb/db
Feng Zhu 0af157f9bf Implement full filter for block based table.
Summary:
1. Make filter_block.h a base class. Derive block_based_filter_block and full_filter_block. The previous one is the traditional filter block. The full_filter_block is newly added. It would generate a filter block that contain all the keys in SST file.

2. When querying a key, table would first check if full_filter is available. If not, it would go to the exact data block and check using block_based filter.

3. User could choose to use full_filter or tradional(block_based_filter). They would be stored in SST file with different meta index name. "filter.filter_policy" or "full_filter.filter_policy". Then, Table reader is able to know the fllter block type.

4. Some optimizations have been done for full_filter_block, thus it requires a different interface compared to the original one in filter_policy.h.

5. Actual implementation of filter bits coding/decoding is placed in util/bloom_impl.cc

Benchmark: base commit 1d23b5c470
Command:
db_bench --db=/dev/shm/rocksdb --num_levels=6 --key_size=20 --prefix_size=20 --keys_per_prefix=0 --value_size=100 --write_buffer_size=134217728 --max_write_buffer_number=2 --target_file_size_base=33554432 --max_bytes_for_level_base=1073741824 --verify_checksum=false --max_background_compactions=4 --use_plain_table=0 --memtablerep=prefix_hash --open_files=-1 --mmap_read=1 --mmap_write=0 --bloom_bits=10 --bloom_locality=1 --memtable_bloom_bits=500000 --compression_type=lz4 --num=393216000 --use_hash_search=1 --block_size=1024 --block_restart_interval=16 --use_existing_db=1 --threads=1 --benchmarks=readrandom —disable_auto_compactions=1
Read QPS increase for about 30% from 2230002 to 2991411.

Test Plan:
make all check
valgrind db_test
db_stress --use_block_based_filter = 0
./auto_sanity_test.sh

Reviewers: igor, yhchiang, ljin, sdong

Reviewed By: sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D20979
2014-09-08 10:37:05 -07:00
..
builder.cc introduce ImmutableOptions 2014-09-04 16:18:36 -07:00
builder.h introduce ImmutableOptions 2014-09-04 16:18:36 -07:00
c_test.c
c.cc Implement full filter for block based table. 2014-09-08 10:37:05 -07:00
column_family_test.cc Ignore missing column families 2014-09-02 13:29:05 -07:00
column_family.cc introduce ImmutableOptions 2014-09-04 16:18:36 -07:00
column_family.h introduce ImmutableOptions 2014-09-04 16:18:36 -07:00
compaction_picker.cc fix more compile warnings 2014-09-05 14:14:37 +08:00
compaction_picker.h
compaction.cc fix more compile warnings 2014-09-05 14:14:37 +08:00
compaction.h
corruption_test.cc
cuckoo_table_db_test.cc Fix compaction bug in Cuckoo Table Builder. Use kvs_.size() instead of num_entries in FileSize() method. 2014-09-05 11:18:01 -07:00
db_bench.cc Implement full filter for block based table. 2014-09-08 10:37:05 -07:00
db_filesnapshot.cc rename options_ to db_options_ in DBImpl to avoid confusion 2014-09-05 11:48:17 -07:00
db_impl_debug.cc Fix valgrind issue 2014-09-08 08:01:25 -07:00
db_impl_readonly.cc rename options_ to db_options_ in DBImpl to avoid confusion 2014-09-05 11:48:17 -07:00
db_impl_readonly.h
db_impl.cc Drop column family from write thread 2014-09-05 15:20:05 -07:00
db_impl.h Drop column family from write thread 2014-09-05 15:20:05 -07:00
db_iter_test.cc
db_iter.cc created a new ReadOptions parameter 'iterate_upper_bound' 2014-09-04 11:00:16 -07:00
db_iter.h created a new ReadOptions parameter 'iterate_upper_bound' 2014-09-04 11:00:16 -07:00
db_test.cc Implement full filter for block based table. 2014-09-08 10:37:05 -07:00
dbformat_test.cc
dbformat.cc remove_internal_filter_policy 2014-08-28 17:06:29 -07:00
dbformat.h fix a few compile warnings 2014-09-04 23:06:23 +08:00
deletefile_test.cc
file_indexer_test.cc
file_indexer.cc
file_indexer.h
filename_test.cc
filename.cc fix more compile warnings 2014-09-05 14:14:37 +08:00
filename.h
forward_iterator.cc Remove path with arena==nullptr from NewInternalIterator 2014-09-04 17:40:41 -07:00
forward_iterator.h Remove path with arena==nullptr from NewInternalIterator 2014-09-04 17:40:41 -07:00
internal_stats.cc fix more compile warnings 2014-09-05 14:14:37 +08:00
internal_stats.h
log_and_apply_bench.cc
log_format.h
log_reader.cc
log_reader.h
log_test.cc
log_writer.cc
log_writer.h
memtable_list.cc Remove path with arena==nullptr from NewInternalIterator 2014-09-04 17:40:41 -07:00
memtable_list.h Remove path with arena==nullptr from NewInternalIterator 2014-09-04 17:40:41 -07:00
memtable.cc Remove path with arena==nullptr from NewInternalIterator 2014-09-04 17:40:41 -07:00
memtable.h Remove path with arena==nullptr from NewInternalIterator 2014-09-04 17:40:41 -07:00
merge_context.h
merge_helper.cc
merge_helper.h
merge_operator.cc
merge_test.cc
perf_context_test.cc
plain_table_db_test.cc introduce ImmutableOptions 2014-09-04 16:18:36 -07:00
prefix_test.cc
repair.cc fix more compile warnings 2014-09-05 14:14:37 +08:00
simple_table_db_test.cc introduce ImmutableOptions 2014-09-04 16:18:36 -07:00
skiplist_test.cc
skiplist.h
snapshot.h fix a few compile warnings 2014-09-04 23:06:23 +08:00
table_cache.cc introduce ImmutableOptions 2014-09-04 16:18:36 -07:00
table_cache.h introduce ImmutableOptions 2014-09-04 16:18:36 -07:00
table_properties_collector_test.cc fix asan check 2014-09-05 09:53:04 -07:00
table_properties_collector.cc
table_properties_collector.h
transaction_log_impl.cc
transaction_log_impl.h
version_edit_test.cc
version_edit.cc
version_edit.h Fix swapped variable names to accurately reflect usage 2014-09-04 20:09:45 -07:00
version_set_test.cc
version_set.cc fix more compile warnings 2014-09-05 14:14:37 +08:00
version_set.h Remove path with arena==nullptr from NewInternalIterator 2014-09-04 17:40:41 -07:00
write_batch_internal.h Ignore missing column families 2014-09-02 13:29:05 -07:00
write_batch_test.cc Remove path with arena==nullptr from NewInternalIterator 2014-09-04 17:40:41 -07:00
write_batch.cc Ignore missing column families 2014-09-02 13:29:05 -07:00