r/programming • u/gilnett • Oct 16 '26
Learned Index Lab: Replacing B-Trees with streaming linear models in pure Rust (-99% RAM, 3x faster)
https://github.com/gilnett/learned_index_labInstead of pointer-chasing through B-Tree node hierarchies, this index models the key distribution using streaming piecewise linear regression with strict epsilon error bounds.
Lookups compute positions directly on the CPU ALU before a local L1 cache search, reducing memory by 99% and cutting latency by 3x.
191
Upvotes
View all comments
7
u/Entmaan Oct 17 '26
Whenever I read articles about behaviors like this, these mindblowing improvements of 99%, 3x etc. I always wonder about one thing:
What specifically is stopping this from just being implemented in all (applicable) cases, if this is such a big improvement? Let's just create an arbitrarily large amount of arbitrarily large and varied datasets, and run benchmarks on them (for speed, correctness, whatever we want). If they all come out as better, it is an obvious no brainer that will completely change the paradigm.
But for some reason it is not being done, why? To clarify I am not trying to "sneakily" suggest that there is something wrong with the proposed solution, I just don't understand what is the "impediment" that prevents these discoveries from just being implemented most of the time