Skip to content

Add range queries #8

Closed
Closed
@criccomini

Description

@criccomini

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:

  1. Creating a snapshot manager that creates, updates, and deletes snapshots from the manifest.
  2. 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).
  3. Creating a user-facing DbIterator that merges the wal, memtable, and L0+ SSTs into a single iterator similar to MergeIterator. We might be able to use MergeIterator directly, I need to check. This iterator interface should have a seek() method.
  4. Update the Db object to have a .iterator() method that returns a DbIterator.

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions