erikgrinaker / toydb

Distributed SQL database in Rust, written as an educational project
Apache License 2.0
6.12k stars 564 forks source link

Iterators should be O(1), streaming, and borrowless #32

Closed erikgrinaker closed 3 months ago

erikgrinaker commented 4 years ago

Iterators are currently rather hacky and inefficient, and e.g. use O(log n) lookups per next() call (B+tree and MVCC) or buffer all results (Raft and SQL engines). Ideally, iterators should have O(1) complexity when calling next(), stream all results (with some amount of IO buffering), and don't hold read borrows to the entire data structure for the lifetime of the iterator.

erikgrinaker commented 3 months ago

Out of scope.