8000 perf: a rule query loads and copies the whole database · Issue #529 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

perf: a rule query loads and copies the whole database #529

Closed

Description

@adityamukho

execute_query_with_rules calls filter_facts_for_query, which for rule queries always does get_live_facts(Scan::All) (live_source_facts: "Rules need the whole fact base"). It then reloads every fact into a fresh FactStorage before the magic-sets rewrite runs. The magic-sets demand cannot narrow what is read. On the #394 envelope a 5-row ancestor walk takes 2.7 s at 100K facts, and at 1M it fails with INT-020 (#528).

Direction: fetch per rule body pattern by index, driven by the magic-set bindings, instead of one up-front copy. This overlaps the Scan/IndexNestedLoopJoin operators in #473.

Found by the #394 performance envelope (examples/perf_envelope.rs, results in docs/BENCHMARKS.md on v3).

Metadata

Metadata

Assignees

No one assigned

    Labels

    performance

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0