Optimize RocksDB prefix scans for persistent forest leaves
- 主要语言
- Rust
- 星标
- 772
- 派生
- 352
- 平均合并
- 1 天 12 小时
- 30 天内合并 PR
- 93
描述
The persistent forest stores leaf keys as `LineageId || leaf_index`. `entries(lineage)` scans leaves by that 32-byte lineage prefix, but `LEAVES_CF` does not set a RocksDB prefix extractor.
RocksDB can use prefix seek optimizations when a prefix extractor is configured:
- [Prefix Seek](https://github.com/facebook/rocksdb/wiki/Prefix-Seek)
- [Iterator: Prefix Iterating](https://github.com/facebook/rocksdb/wiki/Iterator#prefix-iterating)
- [Tuning Guide: Prefix database on flash storage](https://github.com/facebook/rocksdb/wiki/RocksDB-Tuning-Guide#prefix-database-on-flash-storage)
## Suggested change
Set a fixed 32-byte prefix extractor for `LEAVES_CF`, matching `LineageId`.
Benchmark `entries(lineage)` before and after. Only add prefix bloom or hash index tuning if the benchmark supports it.
贡献指南
评估
这个 Issue 还没有评估数据。