Skip to content

Split V2 plan scans along the chunk grid - #11702

Draft
gatesn wants to merge 2 commits into
ngates/v2-plan-bind-cachefrom
ngates/v2-plan-split
Draft

gatesn wants to merge 2 commits into
ngates/v2-plan-bind-cachefrom
ngates/v2-plan-split

Conversation

@gatesn

@gatesn gatesn commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Implements split for PlanDataSource scans, so a host can run one piece per thread. split reads only metadata. It cuts the known rows on whole 8,192-row blocks, the grid every V2 chunk boundary lies on, so no chunk belongs to two pieces. It then groups those blocks into at most n contiguous pieces of about equal rows.

Contracts to check:

  • Coverage. Pieces are non-empty and contiguous, and together they cover every unit exactly once, in child and row order.
  • Grid. Every cut inside a child falls on the block grid. Atoms are sized at about 64 per piece, so the pieces balance.
  • Deferred children. A deferred child is one indivisible unit, weighed as the average ready unit.
  • Limits. A scan with a limit is not split, because a limit holds across the whole scan.

Stacked on #11701.

🤖 Generated with Claude Code

A host that runs one piece per thread needs PlanDataSource scans cut
into pieces of about equal rows. split cuts on whole 8,192-row blocks,
the grid every chunk boundary of the V2 executor lies on, so no chunk
is read by two pieces, and it reads nothing to do so: a deferred child
is one indivisible unit, weighed as the average ready one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant