Skip to content

Sync main with release#211

Merged
conradbzura merged 5 commits into
mainfrom
release
Jul 8, 2026
Merged

Sync main with release#211
conradbzura merged 5 commits into
mainfrom
release

Conversation

@conradbzura

Copy link
Copy Markdown
Collaborator

Auto-generated by the sync branches workflow.

conradbzura and others added 5 commits July 8, 2026 15:44
DuckDB selects its IE_JOIN range-join operator only for INNER
pure-inequality joins. The per-chromosome dynamic SQL for SEMI and ANTI
INTERSECTS joins emitted a bare SEMI JOIN / ANTI JOIN, which DuckDB
planned as a quadratic BLOCKWISE_NL_JOIN (a nested loop) rather than the
range-join fast path -- roughly 80x slower at a million intervals per
side.

Emit the left-only shapes as a correlated WHERE EXISTS (SEMI) /
WHERE NOT EXISTS (ANTI) subquery over the per-chromosome right partition
instead. Both reach IE_JOIN while preserving exact semantics -- one row
per qualifying left row, with no dedup-on-projection hazard. The INNER
path, chromosome partitioning, empty-schema fallback, and WHERE-residual
outer filter are unchanged.

Claude-Session: https://claude.ai/code/session_01TERWBHov76DQM3nQeT8yyy
Update the SQL-shape assertions to expect the correlated EXISTS /
NOT EXISTS form instead of the SEMI JOIN / ANTI JOIN keyword, add an
ANTI shape test, and add execution guards that EXPLAIN the generated
per-chromosome SQL and assert it is not planned as a BLOCKWISE_NL_JOIN.

Claude-Session: https://claude.ai/code/session_01TERWBHov76DQM3nQeT8yyy
Correct the DuckDB IEJoin section: SEMI and ANTI no longer plan as
BLOCKWISE_NL_JOIN; they are emitted as correlated EXISTS / NOT EXISTS
subqueries that reach the IE_JOIN range-join fast path.

Claude-Session: https://claude.ai/code/session_01TERWBHov76DQM3nQeT8yyy
Three Hypothesis property tests cross-checked the duckdb SEMI/ANTI plan
against the dialect=None naive plan. DuckDB 1.4.3 miscompiles the naive
plan's bare SEMI JOIN / ANTI JOIN inequality overlap for inputs with
duplicate right rows, so once the duckdb plan became correct these tests
diverged from their now-unsound oracle and failed. Compare against the
Python overlap reference (_python_semi_overlap / _python_anti_overlap,
with the WHERE residual applied) instead -- ground truth on every DuckDB
version -- and rename the tests to reflect the reference oracle.

Claude-Session: https://claude.ai/code/session_01TERWBHov76DQM3nQeT8yyy
@conradbzura conradbzura merged commit 2b99267 into main Jul 8, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant