Skip to content

len: avoid full table walk #4

@prataprc

Description

@prataprc

Right now len() API does a full table walk to count the number of items indexed. Since we cannot guarantee point-in-time-snapshot, why don't we maintain n_count that gets atomically incremented or decremented for insert/delete operations. This can make len() call very cheap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions