perf(server): batch hydrateRows; per-table catch-up reads use the (tbl,seq) index#14
Merged
Merged
Conversation
…l,seq) index Catch-up hydration was N+1 (one query per key); now chunked IN (≤64) so a 500-key reconnect issues ⌈500/64⌉=8 queries, not 500. The per-table changelog read uses the _sync_changes_tbl_seq composite index via the new readChangesSinceFor() rather than reading all changes and filtering by tbl in JS. Merge note: resolved against plan-006 (already on main) — kept the new readChangesSinceFor and honored 006's deletion of the dead snapshotAll. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jun 13, 2026
Merged
grrowl
added a commit
that referenced
this pull request
Jun 13, 2026
Bug-fix batch from the deep-audit follow-up (audit-excluded SSR topic aside): client reconnect-wedge fix (#12), wire-input hardening + error sanitization (#15, ADR-0012), catch-up N+1 batching (#14), plus expanded error/wire test coverage (#11) and dead-code/identifier-quoting cleanup (#13). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Lands plan-004 on main (0.3.2 patch).
IN(≤64 keys/query) — a 500-key reconnect catch-up issues ⌈500/64⌉=8 queries instead of 500. Identifiers quoted, values bound._sync_changes_tbl_seqcomposite index, replacing read-all-then-filter-by-tbl-in-JS in the catch-up emit path.Behavior is unchanged — same rows, fewer queries.
Merge note: resolved against plan-006 (already on main) — kept the new
readChangesSinceFor, honored 006's deletion of the deadsnapshotAll(the conflict was adjacency, not semantics).Validated on main + published @tanstack/db 0.6.5: typecheck + full suite (155 passed, incl. cdc.test.ts batched-hydration coverage) + build green. Supersedes feat/ssr PR #8.
🤖 Generated with Claude Code