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
perf: EXISTS semijoin cache probe declines EncodedSid rows to the generic per-row path #1320
The cached EXISTS subject-probe fast path (fluree-db-query/src/filter.rs ~line 350, mirrored in optional.rs) only handles decoded subjects:
letBinding::Sid{ sid, .. } = binding else{// Only handle the common single-ledger SID binding here.returnOk(None);};
On a fully-indexed ledger with late materialization, scan-produced subjects are Binding::EncodedSid — so the probe declines every row and the query falls back to the generic correlated-EXISTS evaluation. Correctness is unaffected (the generic path is correct); this is purely a missed optimization, and arguably the common case on indexed reads.
Suggested fix
Handle Binding::EncodedSid { s_id, .. } directly — the cached subject set is keyed by s_id, so the encoded case needs no dictionary lookup at all (cheaper than the existing Sid arm, which does find_subject_id_by_parts). Both copies (filter.rs, optional.rs) need the same change.
Found during the mixed-representation equality audit (fixed separately); this site was verified correctness-safe.
Activity
perf(query): the EXISTS semijoin cache answers encoded subjects (#1320)