Since #2004, a default graph made of ≥2 graphs of one ledger (the union default graph, or FROM naming several of a ledger's graphs) scans each member with eager materialization (DatasetOperator::member_ctx_for). A GRAPH scope also decodes every encoded binding it hands to such a scope (ScopeExit in graph.rs). This fixed a cross product: the multi-graph scope has no graph view, so join substitution left EncodedSid bindings unbound.
Cost: every row decodes subject IRIs and literals as it is scanned. That includes count- and group-only queries, which used to keep IDs encoded through to output.
Possible fix: only NUM_BIG handles are per-graph. Give the multi-graph scope a decode-only view (any member's) for the decoding sites to use, while has_binary_store() stays false so the single-graph fast paths remain off. Members would then eagerly decode NUM_BIG only. Roughly 38 graph_view() call sites in fluree-db-query would need to decide whether to use it.
Measure first: compare eager and late decoding on an indexed ledger over FROM <L> FROM <L#g> (or with the union on), for a count/group query and a join query. Only build this if the gap is material.
Acceptance:
joins_over_several_graphs_of_an_indexed_ledger stays green.
- A new test shows NUM_BIG values from different members decoding against their own graph's arena.
Since #2004, a default graph made of ≥2 graphs of one ledger (the union default graph, or
FROMnaming several of a ledger's graphs) scans each member with eager materialization (DatasetOperator::member_ctx_for). AGRAPHscope also decodes every encoded binding it hands to such a scope (ScopeExitingraph.rs). This fixed a cross product: the multi-graph scope has no graph view, so join substitution leftEncodedSidbindings unbound.Cost: every row decodes subject IRIs and literals as it is scanned. That includes count- and group-only queries, which used to keep IDs encoded through to output.
Possible fix: only NUM_BIG handles are per-graph. Give the multi-graph scope a decode-only view (any member's) for the decoding sites to use, while
has_binary_store()stays false so the single-graph fast paths remain off. Members would then eagerly decode NUM_BIG only. Roughly 38graph_view()call sites influree-db-querywould need to decide whether to use it.Measure first: compare eager and late decoding on an indexed ledger over
FROM <L> FROM <L#g>(or with the union on), for a count/group query and a join query. Only build this if the gap is material.Acceptance:
joins_over_several_graphs_of_an_indexed_ledgerstays green.