0xMiden / 0xMiden/miden-vm

Optimize RocksDB prefix scans for persistent forest leaves

未关闭
#3,528 1 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
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 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。