Skip to content

Graph sources: fuse an OPTIONAL same-subject property into the star as a nullable member #2222

Open

Description

@aaj3f

Over an R2RML graph source, OPTIONAL { ?s p ?x } beside a star on ?s is evaluated as a separate correlated scan: 1 + N scans for N optional properties, where the star member it shadows is a single scan. Fusing it into the star as a nullable member would make it one scan. This extends the star's per-row assumption (a member may be absent), and optional_star_member_is_not_fused_into_star pins today's behavior on purpose, so it's a design change: the fused scan must still keep left-join semantics (a row with the property absent survives, a row with several values multiplies exactly as the OPTIONAL would), including under ORDER BY and LIMIT. Found in #2199's measurements (a crawl with four OPTIONALs).

Follow-up from the review of #2199.

Activity

  1. added
    P3
    triage:needs-decision
    area:query
    on Oct 30, 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:querytriage:needs-decision

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions