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: push-down not/not-join clauses to earliest valid position #248
Not and NotJoin clauses are currently applied as a final post-filter after all positive pattern matching completes. If a not clause's join variables are all bound after pattern 2 of 5, the full binding set is carried through patterns 3–5 before the negation filter reduces it.
Proposed fix
Extend optimizer::plan() to position Not/NotJoin clauses at the earliest valid position where all their join variables are bound by preceding patterns — analogous to the Expr push-down added in #207.
Context
The plan() refactor in #207 (Wave 2 PR 1) extends the planner to handle WhereClause::Expr push-down. The same mechanism can be extended to Not/NotJoin in a follow-up. The groundwork is already in place after that PR lands.
Acceptance criteria
Not/NotJoin clauses are inserted in the plan at the earliest position where all join variables are bound.
Semantics are preserved: a not clause with partially-unbound variables is never evaluated early.
Existing stratification and safety behaviour is unchanged.
Tests for: not clause pushed early, not clause with unbound vars stays at end, not-join pushed to correct position.
Benchmark showing reduction in intermediate binding set size.
Activity
perf: push down not/not-join clauses and short-circuit or/or-join bra…