8000 perf: compute net-assert on v8 index keys before resolving facts (O(live) point queries) · Issue #379 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

perf: compute net-assert on v8 index keys before resolving facts (O(live) point queries) #379

Closed

Description

@adityamukho

Follow-up to #323 (v2.x mitigation).

v8 EavtKey/AevtKey (on the v3 branch) carry value_bytes and asserted. The net_asserted_facts semantics can therefore be computed over index keys before resolve_fact_ref, and only surviving records resolved. Resolve cost becomes O(live facts). The key walk stays O(history), but it runs over B+tree leaf pages, which is far cheaper than a page resolve plus a postcard decode per record.

On v2.x (v7 keys) this isn't possible: the keys carry neither the value nor the asserted flag, and retraction records have their own validity window ([tx_id, ∞)), so liveness can only be decided after resolving every record. #323 therefore only narrows bound-entity scans to the queried attribute and cuts the per-record constant.

Scope: get_facts_by_entity_attribute_indexed, get_facts_by_entity, get_facts_by_attribute on the v3 branch, plus the executor's selective path. :as-of needs tx_count <= N applied on keys first.

Refs #323

Activity

  1. added this to the v3.0.0 milestone on Sep 25, 2026
  2. added a commit that references this issue on Oct 6, 2026
  3. adityamukho commented on Oct 6, 2026

    @adityamukho
    CollaboratorAuthor

    Done on v3 in #459 (a4a1c6d): committed reads decide net-assert on index keys and translate only surviving entries; :as-of N counter queries take the selective index path. Ships in v3.0.0.

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

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0