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
Commit 82e3596
Browse filesBrowse the repository at this point in the historyBrowse files
- JoinKind gains Semi and Anti (left semi/anti: left row emitted at
most once on match / on no match; left-only output schema). Full
stack: logical/physical, memo hash/equality, printers, EXPLAIN, cost
(documented selectivity formulas). Guards: no commute/associate for
Semi/Anti; FilterIntoJoin pushes left-only conjuncts into the
preserved side (proof); LeftJoinToInner inapplicable. Negative tests
per guard.
- Decorrelation transforms (top-level Filter conjuncts only; OR/AND-
embedded forms negative-tested): ExistsToSemiJoin (keyless semi),
NotExistsToAntiJoin (always sound — NULLs irrelevant), InToSemiJoin
(proof: IN=TRUE iff non-NULL equality match, which is exactly
equi-semi-join match; UNKNOWN cases coincide with non-match under
TRUE-only filters). NOT IN never decorrelated (plain anti-join gets
the NULL-bearing-set trap wrong — documented); scalar never
decorrelated (preserves eager cardinality errors).
- Vectorized subquery execution, 21a guard removed completely (0
matches): semi/anti hash joins (NULL-key left rows correctly emitted
by anti join per oracle spec; NLJ fallback for keyless/non-equi);
residual forms (scalar, NOT IN, OR-embedded) evaluate subplans once
recursively via the vectorized engine and compile to constant/set-
membership leaves. Error-path equivalence incl. eager >1-row scalar.
- EXPLAIN golden shows the memo exploring the decorrelated alternative
while costing correctly retains the materialized form for
uncorrelated EXISTS — choose-among-equivalents working as designed.
- Fuzzer: all subquery forms generated (cardinality-safe scalars);
11036 execution paths, 5087 alternatives, 51/25/121 semi/anti/in
decorrelation firings per 160-seed run; no bounds hit.
- Benchmark: selective_in_semi_join — vectorized 2.301x, checksum-
verified (docs/benchmarks.md).
Implemented in one pass; reviewed, gate-verified, merged by lead.
Copy file name to clipboardExpand all lines: ROADMAP.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,8 +20,8 @@
20
20
18. EXPLAIN and global HAVING polish. Delivered in Phase 18: `EXPLAIN <select-statement>` parses as an additive wrapper and returns a deterministic one-column `plan` string batch from a shared optimizer-side renderer used by both engines; the report includes the bound logical plan, memo group/rule summary, `extract_best` chosen plan with per-node row/cost estimates, and total cost. HAVING without GROUP BY is now legal over the single global group with the same aggregate-output and 3VL rules as grouped HAVING, including HAVING-only aggregates that are computed and dropped by final Project. Differential/fuzz alternative extraction caps were raised so the current string-widened corpus no longer hits the plan bound.
21
21
19. Boolean-mask filter kernels. Delivered in Phase 19: vectorized Filter now evaluates WHERE/HAVING predicate trees as paired `is_true`/`is_known` byte masks using SQL Kleene 3VL algebra, with comparison leaves scanning pre-resolved int64 or string values column-at-a-time and `IS [NOT] NULL` leaves reading validity directly. Scan-adjacent identity selections use a dense full-batch domain, while filtered/non-identity inputs use dense selection-position masks that map back to the immutable input selection. Join residual predicates deliberately remain on the existing row-pair path. Release benchmark evidence in `docs/benchmarks.md` shows the three scan/filter vectorized medians improving with byte-identical correctness checks and no material non-target regression.
22
22
20. LEFT/RIGHT OUTER JOIN arc. Delivered across Phase 20a/20b: the parser accepts `LEFT [OUTER] JOIN` and `RIGHT [OUTER] JOIN`; binding normalizes RIGHT to LEFT while stable identities preserve SQL-visible projection order; both interpreted and vectorized engines implement deterministic left-row-major NULL-extension, NULL-key non-matching, and residual-aware matchedness for hash and non-equi joins. `LeftJoinToInnerRule` additively simplifies a filtered LEFT join only under a proof-bearing conservative 3VL null-rejection test, unlocking the existing INNER commute/associate/pushdown exploration without weakening their guards. The deterministic fuzzer now mixes INNER/LEFT/RIGHT chains with actual NULL-bearing key data and verifies standalone rewrites, every memo alternative, and `extract_best` through both engines. The Phase 20a LEFT cardinality rule remains sufficient; no 20b cost-model change was required. The outer-join lowering guard and its verifier path are gone.
23
-
21.Uncorrelated subqueries. Phase 21a adds scalar-comparison, IN/NOT IN, and EXISTS/NOT EXISTS parsing and fresh-scope binding, embeds immutable bound logical subplans in expression leaves, and defines scalar cardinality plus complete IN/EXISTS NULL and empty-set semantics in the interpreted oracle. Memo identity hashes and compares opaque subplan trees without exploring them, EXPLAIN renders them under their owner, costing charges them once, and physical lowering rejects them with one exact vectorized-not-supported guard. Deterministic goldens and an oracle-only differential path cover nested, join, aggregate, NULL, empty, LIMIT 0, correlation-error, type-error, and scalar-cardinality cases. Fuzzer generation remains deliberately unchanged in 21a.
24
-
22.Subquery decorrelation and execution (Phase 21b). Convert supported subquery forms into explicit semi/anti-join and related scalar algebra with proof-bearing NULL/bag-semantics guards, then add vectorized physical support and deterministic seeded fuzzer generation. Phase 21b revisits the 21a memo-opacity decision only after decorrelated operators make equivalence and costing explicit; correlated subqueries remain out of scope unless a later phase specifies their semantics and scope model.
23
+
21.Complete uncorrelated-subquery arc. Delivered across Phase 21a/21b: scalar-comparison, IN/NOT IN, and EXISTS/NOT EXISTS use fresh-scope immutable bound subplans and the pinned eager once-per-query 3VL/cardinality oracle. Explicit left SEMI/ANTI algebra has left-only output identity, deterministic interpreted and vectorized hash/NLJ execution, memo identity/printers/EXPLAIN/costing, and conservative transform guards. Top-level Filter EXISTS, NOT EXISTS, and IN decorrelate through proof-bearing memo rules; OR-contained leaves, NOT IN, and scalar forms stay materialized. Residual vectorized subqueries recursively execute once through the vectorized engine, scalar results compile as nullable constants, and IN sets use lookup-only typed hashes plus empty/NULL flags. Exact EXPLAIN goldens, a ten-mode 160-seed full-stack fuzzer, eager error equivalence, and a 100k-row selective-IN benchmark close the arc; the temporary lowering guard and oracle-only verifier path are gone.
24
+
22.Correlated subqueries (future). Define an explicit outer-reference scope model and correlation algebra before adding binding or execution. Phase 21 deliberately rejects correlated names; no decorrelation rule may infer correlation from unresolved identifiers.
0 commit comments