facebook / facebook/rocksdb

DB::Advance() API

Open
#6,289 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
32.1k
Forks
6.9k
Avg merge
32m
Merged PRs (30d)
1

Description

As it stands, unless I am mistaken, DB::Seek() will not consider the iterator 'offset' and thus it will seek to the `(first key >= target)` starting from the _beggining_. In other words, if you have been using an Iterator to process KVs and you want to seek to the next KV with key >= X where that KV is past the current iterator 'offset', you can't because Seek() will locate it starting from the beginning.

You can fallback to fancy keys encoding to accomplish that, but it seems somewhat expensive because no matter what, iteration still starts at the first key in the source.

It would have been valuable to provide an Advance() API that would seek starting from the current iterator offset, or maybe allow for configuring that behaviour using ReadOptions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.