Skip to content

Query: support cursor-based prefix iteration (key_prefix_from) #109

Description

@royalcala

Problem

get_many with key_prefix always starts scanning from the beginning of the prefix. For applications that maintain a cursor (e.g., iterating over an event log from the last processed position), this forces O(n) client-side skipping via offset.

Proposed solution

Add a from: Option<Bytes> field to Query and a key_prefix_from(prefix, cursor) method on QueryBuilder. When using SortBy::KeyAuthor, the B-tree lower bound is set to the cursor position instead of the prefix start — O(log n) seek.

PR

#108

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    🚑 Needs Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions