You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
History scans: push a bound object into the persisted walk's BinaryFilter #2143
The history scan's persisted walk narrows leaves and rows by subject and predicate only. BinaryScanOperator::build_filter_from_snapshot_sids always returns o_type: None, o_key: None (fluree-db-query/src/binary_scan.rs), and the history operator uses that filter as is. Since #2133, a bound object, its datatype and its bounds are matched on the decoded events, which is correct. But every event of the subject and predicate in the range is still decoded first, and the non-matching ones are then thrown away.
The current-state scan already pushes the object into its filter: BinaryScanOperator::open extends the same filter with object slices. The history walk could do the same.
What that would change:
?s ex:p "o" over a wide from/to range: rows and sidecar entries whose object differs are skipped by filter.matches, before decode_event_to_flake.
Object-only patterns (?s ?p "o"): pick_order in binary_history.rs has an OPST branch for "object bound, no subject, no predicate", but it can't fire without a planner hint, because the filter never carries the object. Such a query walks every leaflet in SPOT order today. With the object in the filter, it would take OPST, and leaflet_matches_filter could skip leaflets.
Correctness doesn't depend on this, because the shared object check after the walk still applies. Any change here should keep that check and keep history_range_bound_object_matches_only_that_object (it_query_history_range.rs) green on both lanes.
Raised in the review of #2133 as an optimization, outside that fix.
Activity