Repository navigation
perf: sweep 5a — set-based entity writes: updateAll/deleteAll, updateMany, returning:false, copyAll (COPY), page byte bound - #1087
Merged
Conversation
…Many, returning:false, copyAll (COPY), page byte bound
Plan 101-full-stack-efficiency-sweeps, sweep 5a (05-entity E1–E4, E13).
- E1: db.x.where(…).updateAll(patch) / .deleteAll() — one statement, any operator, tenant-scoped
as reads; empty or undefined predicate X_WRITE_UNFILTERED; limit/after/search refused.
updateWhere/deleteWhere run the same plan.
- E2: updateMany([{ id, patch }]) — UPDATE … FROM a table-typed source per bind chunk
(1,000 rows = 1 statement); same columns, unique ids, non-null ids.
- E3: insertAll/upsertAll { returning: false } → count; copyAll via COPY FROM STDIN
(≤ 50,000 rows per COPY, one transaction; insert under row security), db copyIn/canCopyIn;
100k rows: copyAll ~1.1 s vs insertAll ~2.9 s.
- E4: pages bounded at MAX_PAGE_BYTES (64 MiB, X_ENTITY_PAGE_TOO_LARGE); inBatches halves.
- E13: closed by a live test (reads already cancel through statement-cancel).
- Conformance: 208 checks × memory, defineDriver, PGlite, Postgres.
- Review fixes: COPY under RLS, anchored COPY target, iterator errors coded, nullish ids,
fallback refusals.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, ceilings +12 (measured, listed) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dos) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
⏭️ Skipped: the pull request was merged or closeddeveloperz.ai skipped the review of this commit: the pull request was merged or closed. This is not a verdict on the changes. 🤖 developerz.ai — automated review, running on your box. This review was skipped. |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plan
docs/plans/2026/11/11/101-full-stack-efficiency-sweeps, sweep 5a: slice 05 rows E1–E4, E13.Scale: 6 agents (integrator + 4 feature workers + conformance), 1 independent review (0 High; 2 Medium + 5 Low, all fixed), 1 gate fixer, 1 docs agent; 89 files.
Measured
.where(…).updateAll())updateMany)insertAll~2.9 s (returning *)returning:false0.69–0.73× ·copyAll~1.1 s (COPY, ≤ 50k rows per COPY, one transaction)X_ENTITY_PAGE_TOO_LARGE, 64 MiB);inBatcheshalvesWhat
db.x.where(…).updateAll(patch)/.deleteAll(): chain terminals (named soTablestays aReadBuilder), one statement, any operator, tenant-scoped exactly as reads; an empty orundefinedpredicate isX_WRITE_UNFILTERED;limit/after/searchrefused.updateWhere/deleteWhererun the same plan.updateMany([{ id, patch }]):UPDATE … FROMa table-typed source (a boundVALUESlist can't join uuid columns), chunked by binds; same columns, unique non-null ids.insertAll/upsertAll{ returning: false }→ count;copyAlloverCOPY FROM STDIN(dbcopyIn/canCopyIn; insidewithTransactiontoo; primary-only under the replica router; insert under row security, since Postgres refuses COPY on RLS tables); target anchored, iterator errors coded..select({…}).limit(n).statement-cancel(in-flight and queued).defineDriverfallbacks. Conformance: 208 checks × memory, defineDriver, PGlite, Postgres.Gate
bun run verify(pre-rebase): reds fixed in the last commit; only the load-sensitive raster test failed under 9 workers (passes alone 3/3).scripts/reference-app-gate.ts: all three apps 21/21. After rebase onto 31.8.0:verify --only typecheck,lint,errors,manifestgreen.🤖 Generated with Claude Code