perf(storage): use two-level index with partitioned filters (RocksDB)#6196
perf(storage): use two-level index with partitioned filters (RocksDB)#6196azteca1998 wants to merge 1 commit intomainfrom
Conversation
Enable TwoLevelIndexSearch with partitioned filters on all column families. This splits large index and filter blocks into smaller 4 KB partitions with a top-level index, so only the partitions needed for a lookup are loaded into cache rather than the entire index block. Configuration applied to all CFs via a shared helper closure: - TwoLevelIndexSearch index type - Partitioned filters enabled - 4 KB metadata block size - Index/filter blocks cached in block cache (bounded memory) - Top-level index and L0 filter/index blocks pinned in cache This significantly reduces memory overhead for large SST files (256-512 MB targets in this config) and improves block cache efficiency by avoiding cache pollution from oversized index blocks. No resync required — RocksDB applies the new index format to SST files produced by subsequent compactions.
🤖 Kimi Code ReviewReview SummaryThis PR introduces partitioned index/filter blocks for RocksDB to improve performance with large datasets. The changes are well-structured and follow good practices. Issues Found1. Potential Performance Regression (Line 87-92)
2. Missing Configuration Validation
These settings increase memory usage and could cause OOM on memory-constrained systems. 3. Magic Numbers Without Documentation
Suggestions
The code is otherwise well-structured and follows Rust best practices. The use of a closure to avoid repetition is clean and maintainable. Automated review by Kimi (Moonshot AI) · custom prompt |
🤖 Claude Code ReviewNow let me provide my code review: Code Review: PR #6196 - Two-Level Index with Partitioned FiltersSummaryThis PR adds two-level indexing with partitioned filters to RocksDB configuration across all column families. The implementation is straightforward and the optimization is well-motivated for large SST files in blockchain storage scenarios. ✅ Positive Aspects
|
🤖 Codex Code ReviewReview Summary Small, focused change. No EVM/consensus/state/transaction logic touched. Main impact is RocksDB table configuration for all CFs. Code is clean and idiomatic. Findings
Performance Notes
Security / Correctness
If you want, I can check for existing block cache config to see if the pinning is safe by default. Automated review by OpenAI Codex · custom prompt |
Lines of code reportTotal lines added: Detailed view |
Enable TwoLevelIndexSearch with partitioned filters on all column families. This splits large index and filter blocks into smaller 4 KB partitions with a top-level index, so only the partitions needed for a lookup are loaded into cache rather than the entire index block.
Configuration applied to all CFs via a shared helper closure:
This significantly reduces memory overhead for large SST files (256-512 MB targets in this config) and improves block cache efficiency by avoiding cache pollution from oversized index blocks.
No resync required — RocksDB applies the new index format to SST files produced by subsequent compactions.
Motivation
Description
Checklist
STORE_SCHEMA_VERSION(crates/storage/lib.rs) if the PR includes breaking changes to theStorerequiring a re-sync.