Skip to content

Corgi join: one path for every projection - #899

Merged
frankmcsherry merged 1 commit into
master-nextfrom
ddir-join-one-path
Sep 23, 2026
Merged

frankmcsherry merged 1 commit into
master-nextfrom
ddir-join-one-path

Conversation

@frankmcsherry

Copy link
Copy Markdown
Member

The corgi join routed projections that compilable rejected (a case, list
intro, a data-driven tag) through a second path: join with the identity
projection, then apply the terms as a rebased row-environment Project. The
premise was that join projections are compiled before any container is in
hand. They are not: CorgiJoinBackend compiles the projection per block
against the matched columns' shapes, so every term it can lower as a Project
it can lower in the join.

Removes compilable, rebase_join_term, and the fallback branch; the
join_fallback test program stays, with its header rewritten.

Measured (ddir_server, corgi backend, joins of two random 1M-edge relations
on 200k nodes, then 50 ticks of 1000 changes; two runs each, master-next ->
this): a case projection loads in 1.43-1.46s -> 1.48s with churn unchanged
(437-438ms -> 439-440ms for the 50 ticks); a plain projection is unchanged
(1.44-1.45s, 436-438ms). The small load cost is the per-block compile of the
case term, which the fallback compiled once; caching the graph by shape in
the join would remove it if it matters.

Validation: workspace tests pass (including join_fallback, which checks agreement with the vec backend); clippy warning count unchanged.

🤖 Generated with Claude Code

The corgi join routed projections that `compilable` rejected (a `case`, list
intro, a data-driven tag) through a second path: join with the identity
projection, then apply the terms as a rebased row-environment `Project`. The
premise was that join projections are compiled before any container is in
hand. They are not: `CorgiJoinBackend` compiles the projection per block
against the matched columns' shapes, so every term it can lower as a `Project`
it can lower in the join.

Removes `compilable`, `rebase_join_term`, and the fallback branch; the
`join_fallback` test program stays, with its header rewritten.

Measured (ddir_server, corgi backend, joins of two random 1M-edge relations
on 200k nodes, then 50 ticks of 1000 changes; two runs each, master-next ->
this): a `case` projection loads in 1.43-1.46s -> 1.48s with churn unchanged
(437-438ms -> 439-440ms for the 50 ticks); a plain projection is unchanged
(1.44-1.45s, 436-438ms). The small load cost is the per-block compile of the
`case` term, which the fallback compiled once; caching the graph by shape in
the join would remove it if it matters.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@frankmcsherry
frankmcsherry merged commit 5870dd4 into master-next Sep 23, 2026
6 checks passed
@frankmcsherry
frankmcsherry deleted the ddir-join-one-path branch September 23, 2026 10:37
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