mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
enable bloom filters for celldb
This commit is contained in:
parent
3c245c6146
commit
34f80e8f1b
7 changed files with 26 additions and 0 deletions
|
|
@ -24,6 +24,7 @@
|
|||
#include "rocksdb/write_batch.h"
|
||||
#include "rocksdb/utilities/optimistic_transaction_db.h"
|
||||
#include "rocksdb/utilities/transaction.h"
|
||||
#include "rocksdb/filter_policy.h"
|
||||
|
||||
namespace td {
|
||||
namespace {
|
||||
|
|
@ -75,6 +76,9 @@ Result<RocksDb> RocksDb::open(std::string path, RocksDbOptions options) {
|
|||
} else {
|
||||
table_options.block_cache = options.block_cache;
|
||||
}
|
||||
if (options.enable_bloom_filter) {
|
||||
table_options.filter_policy.reset(rocksdb::NewBloomFilterPolicy(10, false));
|
||||
}
|
||||
db_options.table_factory.reset(rocksdb::NewBlockBasedTableFactory(table_options));
|
||||
|
||||
db_options.use_direct_reads = options.use_direct_reads;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue