Closed
Description
Add range queries to Db and DbInner. I'm thinking we'll copy RocksDB's interface, which has a db.iter()
and iter.seek()
API.
At a high level, I think this work involves a few things:
- Creating a snapshot manager that creates, updates, and deletes snapshots from the manifest.
- Cloning the current DB state, including the memtables and wal data structures. This will be needed for the iterator, so it has a consistent point in time to iterate over all data (both in-memory and on disk/obj storage). I'm thinking this might be included as part of the snapshot manager (i.e. each snapshot in the manager will be a full
Db
with a state at a point in time). - Creating a user-facing
DbIterator
that merges the wal, memtable, and L0+ SSTs into a single iterator similar toMergeIterator
. We might be able to useMergeIterator
directly, I need to check. This iterator interface should have aseek()
method. - Update the
Db
object to have a.iterator()
method that returns aDbIterator
.
For (3), I suspect if we use MergeIterator
, we'll need a DbMergeIterator (similar to TwoMergeIterator) that takes iterators for wals, memtables, and SSTs (because of the Rust typing issue mentioned here
I don't plan to tackle prev()
in this issue.