RMI Minimal Demo
A 50-line 2-stage Recursive Model Index (RMI) to accompany the article 学习型索引再审视:RMI、ALEX、PGM.
Dependencies
- Python 3.9+
numpy==1.26.4
Install:
pip install numpy==1.26.4Run
python rmi_minimal.pyWhat it shows
- Train a 2-stage RMI on 1M uniformly distributed sorted
int64keys. - Report
avg_errandmax_errof the predicted position vs. the real position. - Compare average probe counts of
rmi_lookup(prediction + bounded local binary search) against plain binary search on the same sample. - Inject 1% random inserts without retraining and
re-measure error — the
max_errtypically explodes, which is exactly the reason ALEX / PGM / RadixSpline exist.
Offline
The demo uses only numpy and deterministic
seeds. No network or dataset download is required.
同主题继续阅读
把当前热点继续串成多页阅读,而不是停在单篇消费。
【数据库研究前沿】Text-to-SQL 与 Agentic Query:DIN-SQL、C3、DAIL-SQL 工程复盘
Spider / BIRD 评测、DIN-SQL / C3 / DAIL-SQL 的核心机制、schema linking 与 self-consistency,以及一个离线可跑的最小 Text-to-SQL 闭环 demo
【数据库前沿】【数据库研究前沿】流批一体与增量视图:Materialize、RisingWave、Feldera 的 DBSP 理论
以 IVM 历史、Differential Dataflow、DBSP(Z-set 与线性化)为主线,对比 Materialize、RisingWave、Feldera 的架构取舍,划清与 Flink/Kafka Streams 的能力边界,并附 Python Z-set 最小增量 join demo
【数据库前沿】【数据库研究前沿】HTAP 新范式:从 TiDB、SingleStore 到 Lakehouse 一体化
从工作负载隔离到行列双维护,系统梳理 TiDB + TiFlash、SingleStore Universal Storage、F1 Lightning 与 Lakehouse 的设计取舍、新鲜度边界与 HTAP 基准测试方法
【数据库前沿】【数据库研究前沿】Serverless 数据库弹性理论:Neon 与 Aurora Serverless v2
从 Aurora 的日志即数据库到 Neon 的 pageserver/safekeeper/compute 三层分离,拆解 Serverless 数据库的冷启动、细粒度伸缩与 copy-on-write 分支,并给出本地可跑的 Neon demo 指引