Skip to content

schema() label counts build each node to check its visibility #546

Description

@StevenBtw

To count only committed nodes, schema() (crates/grafeo-engine/src/database/admin.rs) checks each node of a label with get_node_at_epoch and has_label, which builds the node with its properties: O(nodes) work and allocation per call. The label index itself is updated before commit, so its O(1) size counts other transactions' uncommitted nodes.

Fix idea: an epoch-aware label count in the graph store (visible versions only, without building nodes), for example a visibility check plus a labels-at-epoch read, or committed per-label counters maintained at commit.

Raised in the review of #541.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions