Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions crates/storage/backend/rocksdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ impl RocksDBBackend {
RECEIPTS,
TRANSACTION_LOCATIONS,
FULLSYNC_HEADERS,
ACCOUNT_TRIE_NODES,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scope difference vs #6529 worth surfacing: this PR expands point_lookup_cfs to include ACCOUNT_TRIE_NODES, STORAGE_TRIE_NODES, ACCOUNT_FLATKEYVALUE, STORAGE_FLATKEYVALUE. #6529 doesn't touch this array. The point_lookup_cfs set drives other optimizations (the optimize_for_point_lookup path elsewhere in this file) — adding trie/FKV CFs here changes their broader RocksDB tuning, not just the binary-hash index.

Worth a brief justification in the PR description for why these four CFs belong in the point-lookup set. Trie nodes and flat KV are both keyed lookups (32-byte keys), so the choice is sound, but it's a non-trivial config change that's separate from the binary-hash index addition. Could be split into its own PR if the team wants surgical perf work.

STORAGE_TRIE_NODES,
ACCOUNT_FLATKEYVALUE,
STORAGE_FLATKEYVALUE,
];

// opts.enable_statistics();
Expand Down Expand Up @@ -121,6 +125,8 @@ impl RocksDBBackend {
let mut block_opts = BlockBasedOptions::default();
block_opts.set_block_size(16 * 1024); // 16KB
block_opts.set_bloom_filter(10.0, false);
block_opts.set_data_block_index_type(rocksdb::DataBlockIndexType::BinaryAndHash);
block_opts.set_data_block_hash_ratio(0.75);
Comment thread
dicethedev marked this conversation as resolved.
Outdated
block_opts.set_block_cache(&block_cache);
cf_opts.set_block_based_table_factory(&block_opts);
}
Expand All @@ -134,6 +140,8 @@ impl RocksDBBackend {
let mut block_opts = BlockBasedOptions::default();
block_opts.set_block_size(16 * 1024); // 16KB
block_opts.set_bloom_filter(10.0, false); // 10 bits per key
block_opts.set_data_block_index_type(rocksdb::DataBlockIndexType::BinaryAndHash);
block_opts.set_data_block_hash_ratio(0.75);
block_opts.set_block_cache(&block_cache);
cf_opts.set_block_based_table_factory(&block_opts);
}
Expand All @@ -147,6 +155,8 @@ impl RocksDBBackend {
let mut block_opts = BlockBasedOptions::default();
block_opts.set_block_size(16 * 1024); // 16KB
block_opts.set_bloom_filter(10.0, false); // 10 bits per key
block_opts.set_data_block_index_type(rocksdb::DataBlockIndexType::BinaryAndHash);
block_opts.set_data_block_hash_ratio(0.75);
block_opts.set_block_cache(&block_cache);
cf_opts.set_block_based_table_factory(&block_opts);
}
Expand All @@ -162,6 +172,8 @@ impl RocksDBBackend {

let mut block_opts = BlockBasedOptions::default();
block_opts.set_block_size(32 * 1024); // 32KB
block_opts.set_data_block_index_type(rocksdb::DataBlockIndexType::BinaryAndHash);
block_opts.set_data_block_hash_ratio(0.75);
block_opts.set_block_cache(&block_cache);
cf_opts.set_block_based_table_factory(&block_opts);
}
Expand All @@ -172,6 +184,8 @@ impl RocksDBBackend {

let mut block_opts = BlockBasedOptions::default();
block_opts.set_block_size(32 * 1024); // 32KB
block_opts.set_data_block_index_type(rocksdb::DataBlockIndexType::BinaryAndHash);
block_opts.set_data_block_hash_ratio(0.75);
block_opts.set_block_cache(&block_cache);
cf_opts.set_block_based_table_factory(&block_opts);
}
Expand All @@ -183,6 +197,8 @@ impl RocksDBBackend {

let mut block_opts = BlockBasedOptions::default();
block_opts.set_block_size(16 * 1024);
block_opts.set_data_block_index_type(rocksdb::DataBlockIndexType::BinaryAndHash);
block_opts.set_data_block_hash_ratio(0.75);
block_opts.set_block_cache(&block_cache);
cf_opts.set_block_based_table_factory(&block_opts);
}
Expand Down
Loading