Skip to content

Look up the tree's node size once per write - #305

Merged
reeceyang merged 1 commit into
mainfrom
btree-max-node-size
Dec 2, 2026
Merged

reeceyang merged 1 commit into
mainfrom
btree-max-node-size

Conversation

@reeceyang

@reeceyang reeceyang commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Passes each tree's maxNodeSize down through insertIntoNode and deleteFromNode instead of looking the btree row up again at every level, which ran several identical index queries per write. In a load test of 1024-op async batches over 220 trees, this cut document reads per batch from about 11k to 7.4k.

Stack


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

🤖 Generated with Claude Code

insertIntoNode and deleteFromNode looked up the btree row at every level just
to read maxNodeSize, so each write ran several identical index queries.
Pass the size down from the handler instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@reeceyang
reeceyang force-pushed the btree-max-node-size branch from 79dc8ca to 220c518 Compare December 2, 2026 22:50
@pkg-pr-new

pkg-pr-new Bot commented Dec 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@convex-dev/aggregate@305

commit: 220c518

@reeceyang
reeceyang marked this pull request as ready for review December 2, 2026 22:57

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

@reeceyang
reeceyang merged commit 1f68e83 into main Dec 2, 2026
3 checks passed
@github-actions github-actions Bot mentioned this pull request Dec 2, 2026
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.

2 participants