Skip to content

Novelty and CompositeOverlay don't count a predicate's overlay range, so a cold reasoning lane over heavy novelty stays per-row #2324

Open

Description

@bplatz

Raised in review of #2271 (#2271 (comment)).

#2271 defers a cold eager lane's overlay plan to the first flush. If that flush is final and holds fewer than extent / 8 rows, the rows run per-row (COLD_LANE_FLAKES_PER_ROW in join.rs). extent is the probed predicate's overlay flake count, from OverlayProvider::overlay_range_flake_count (via fast_path_common::predicate_overlay_extent).

The reasoning overlay answers that count for the predicate's range. Novelty and CompositeOverlay (fluree-db-api/src/overlay.rs) don't implement it, so the count falls back to the whole graph's novelty. With a lot of unindexed novelty, a cold final flush with fewer than novelty / 8 rows goes per-row, whatever the probed predicate's own extent is. It is never slower than main, which ran every eager join per-row, but it gives up the lane in those cases.

Fix. Novelty's segments already return a range as a slice (seg.range(index, first, rhs, leftmost), fluree-db-novelty/src/lib.rs), so the count is a sum of len()s over the graph's segments. StagedLedger and CompositeOverlay can sum their layers the same way.

Test. An indexed ledger with a large novelty extent on predicate A and a small derived extent on predicate B. A cold one-row reasoning probe of B should take the lane once the count is per-predicate, and run per-row before.

Activity

  1. added
    P3
    area:query
    performance
    on Nov 11, 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:queryperformance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions