Skip to content

Keep a list census in the index root #2172

Open

Description

@bplatz

Targets next: it changes the index format.

Follow-up from #2159.

Problem

On a ledger that has held any list, SPARQL's list view needs to know which predicates hold lists, and the COUNT(*) / GROUP BY ?p fast paths need each predicate's list and member counts. #2159 derives both from the index: list predicates from POST leaflet directories, once per index store, and counts from the list-bearing PSOT leaflets of those predicates. That costs:

  • a directory walk on each index store's first query that needs it, repeated after every index build (the set is not carried forward);
  • on the wasm residency tier, whole-leaf fetches, since residency holds full blobs;
  • no correction for a ledger with novelty (those lanes decline there for every ledger, so it is parity, not a regression).

Proposal

Have the indexer record, per graph and predicate, its list count and member count in the index root, maintained incrementally (members by delta; lists by recounting the owners an incremental build touches). Optionally record per-leaflet member counts in the leaflet directory and HAS_O_I in the branch manifest, so count lanes and bound-subject checks need no leaf opens.

The FIR6 decoder rejects trailing bytes, so this is a format change.

Activity

  1. added
    P3
    area:storage
    on Oct 24, 2026
  2. added this to the 5.0.0 milestone on Nov 20, 2026
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

    P3area:storage

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions