Skip to content

Better abstraction for database Seek #3268

@infrmtcs

Description

@infrmtcs

However, this can be done much better, because the current abstraction NewIterator is pretty bad. It doesn't provide a lot features that are provided by pebble:

  • Missing Last(), which prevent reverse iteration
  • Customized range instead of by prefix only, like (key, 0) -> (key, height - 1), which is what we need in this case.
  • SeekLT, which is exactly what we need here instead of SeekGE used by it.Seek. This is why we have to check if seekedHeight < height ... else if seekedHeight == height ...

Originally posted by @infrmtcs in #3253 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions