fix(db): allow indexing on live-query Collections #2314
main fromrefs/pull/2314/head·merged by KyleAMathews(GitHub profile, opens in a new tab) 🎯 Changes#
Live-query Collections can now accept autoIndex and defaultIndexType. This lets downstream filters and ordered pages create matching indexes on cached intermediate results. Previously, these configuration entry points omitted both options, so callers needed manual indexes for each downstream order.
Configure the Collection that holds the intermediate rows:
import { BasicIndex, createLiveQueryCollection } from '@tanstack/db'
const cachedUsers = createLiveQueryCollection({
query: (q) => q.from({ user: usersCollection })
.select(({ user }) => ({ id: user.id, name: user.name })),
autoIndex: 'eager',
defaultIndexType: BasicIndex,
})
const firstUsers = createLiveQueryCollection((q) =>
q.from({ user: cachedUsers }).orderBy(({ user }) => user.name).limit(20)
)
The downstream query creates its matching index on cachedUsers. The same options work with liveQueryCollectionOptions and framework hook configs. Each output Collection controls its own indexing. The options leave source Collections unchanged and introduce no inherited policy or DbClient default.
Automatic indexing still defaults to 'off'. Eager indexing requires an explicit constructor. A constructor alone supplies the type for manual indexes and leaves automatic indexing off.
Independent React Suspense bindings share an output only when their local Collection options agree. The key includes all supplied options, with exact object/function reference identity. Mounted bindings retain their options until query identity changes. Portable query identity and existing DbClient getKey/schema conflicts stay unchanged.
DbClient.preloadLiveQuery now validates every eager declaration, including warm reuse: defaultIndexType is required even when rows are already cached. Pooling remains limited to configs containing only query, pool, and gcTime; the guide now explains the opt-out from additional keys.
🔬 Oracle Coverage#
The original indexing evidence preserves the initial RED/GREEN runs. The high-effort review record evaluates all ten candidates, records the two maintainer decisions, and gives final calibration and limits.
- Law: Explicit output indexing, independent-caller option compatibility, per-call eager admission, and mounted first-option retention. Authority: Collection's indexing contract and the maintainer decisions recorded above.
- Reach: 18 core output configurations, nine indexing declarations per framework, 534 Suspense indexing histories, 348 independent local-option histories, and 459 cold/pending/settled preload histories. Warm React cached-result admission also receives 144 cases through Suspense.
- RED: Original production fails 206/1,314 final React receiving histories and 32/459 preload histories. The old sharing checker accepts a production mutant that drops query hash in all 534 histories.
- GREEN: Full React suite: 4,039 tests/34 files. Selected DB admission/cache/indexing/error suites: 5,185 tests/7 files. All five other framework receivers pass nine indexing cases each. DB/React typechecks, lint, and production error erasure pass.
- Mutant: The repaired sharing checker rejects 28 real over-sharing histories. A narrow indexing/getKey/schema-only key fails 110 local-option histories. Equal-name labels fail both registration calibrations. Core comparisons reject extra indexes and inverted optimized-read availability. All source was restored before final verification.
- Limits: Finite in-memory declarations, initial bindings and held/settled preload delivery. No arbitrary hydration/SSR scheduling, backend paging or benchmark claim. Mounted options deliberately bind until query identity changes. No oracle run budget is lowered.
✅ Checklist#
- Targeted core, adjacent, and all six framework test suites passed locally.
- TypeScript checks,
pnpm lint:changed, and the new guide snippet passed.
🚀 Release Impact#
- This change affects published code and includes a patch changeset for
@tanstack/dband@tanstack/react-db. - This change is docs/CI/dev-only (no release).
pnpm size:compare --packages db,react-db --files reports 363 gzip bytes and 355 brotli bytes saved across both production package bundles. The typical app saves 319 gzip bytes and 186 brotli bytes. All eight measured app scenarios shrink in both formats. DB alone adds 47 gzip bytes and saves three brotli bytes; React saves 410 gzip and 352 brotli bytes.
The size refactor passes private Suspense metadata directly, removes a stored cache key and duplicate preparation, and lets production bundlers erase development timing state and machinery. Validation and lifecycle/error checks remain enabled. The full React suite is verified with TANSTACK_DB_ORACLE_RUNS_MULTIPLIER=3; a preceding default-budget run missed the streaming campaign's required held-suspense-first state, without a production mismatch. No oracle budget or coverage gate was reduced.
A separate SQLite metadata failure was reproduced on both this PR and its merge-base and is tracked in #2317. CI also found an ordered-replay error-identity mismatch that reproduces on both this head and main 85392bd1d; its exact seed, minimized history, and main control are recorded in #2315. The maintainer chose to track that investigation separately. The replay comparison and random campaign remain unchanged; CI is red on that witness.
Fixes #2292.
Summary by CodeRabbit#
- New Features
- Configure
autoIndexanddefaultIndexTypefor live-query collections and hooks. Automatic indexing remains off by default; eager indexing requires an index constructor. - Downstream queries can create matching indexes on live-query results without changing source collection settings. An index constructor alone still allows manual index creation.
- Configure
- Bug Fixes
- React Suspense bindings retain their collection options and share collections only when options are compatible, including object and function references.
- Eager-indexing configuration is validated on every preload, including when results are cached.
- Documentation
- Added guidance on live-query indexing, Suspense option sharing, pooled-query configuration, and when pooled queries compile their own collection.
Oracle follow-up (2026-11-02)#
Added omitted-versus-explicit-undefined histories and two-peer pending-source Suspense histories, with per-scope reach guards. Both hostile implementations pass the previous 882 receiver histories; the extended receivers reject them with 88 and 36 intended assertion failures. All 1,074 extended histories pass unchanged production; broader validation passes 1,554 React tests and 744 DB tests, TypeScript, formatting and changed-file lint. No production code changed. Versioned evidence and limits.
- 1
Note
Reviews paused#
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
reviews.auto_review.auto_pause_after_reviewed_commitssetting.- Last reviewed commit: a0d2c4e3780307a770ef7734b64a2d4adf5bd3ce
- Latest commit, not reviewed: c9c04f88a46b76225f2ddb51f2a70f0eee15c7fb
Use the following commands to manage reviews:
@coderabbitai resumeto resume automatic reviews.@coderabbitai reviewto trigger a single review.
Use the checkboxes below for quick actions:
- ▶️ Resume reviews
- 🔍 Trigger review
No actionable comments were generated in the recent review.
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
10df2075-73b6-4c07-b4f6-cb140516f436
Commits-
Reviewing files that changed from the base of the PR and between 80985a1ab99c5573fe66dc9d894f575188dbf45c and a0d2c4e3780307a770ef7734b64a2d4adf5bd3ce.
Files selected for processing: 2-
docs/contributing/oracle-coverage.mddocs/contributing/oracle-reviews/2026-10-30-pr-2314-high-effort-review.md
Files skipped from review as they are similar to previous changes: 2-
- docs/contributing/oracle-coverage.md
- docs/contributing/oracle-reviews/2026-10-30-pr-2314-high-effort-review.md
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.
-
Walkthrough
-
Live-query Collections now accept
autoIndexanddefaultIndexType. The settings reach output Collections, and eager indexing without a default index type is validated during Collection construction and each preload. React Suspense cache reuse accounts for source identity and normalized output options.Changes: Live-query output indexing
Layer / File(s) Summary Forward and validate indexing settings
packages/db/src/query/live/types.ts,packages/db/src/query/live/collection-config-builder.ts,packages/db/src/collection/*,packages/db/src/client.ts,packages/db/tests/query/live-query-indexing.test-d.ts,packages/db/tests/fixtures/error-site-messages.jsonLiveQueryCollectionConfigacceptsautoIndexanddefaultIndexType, and the builder forwards both values. Shared validation rejects eager indexing without a default index type during Collection construction and preload setup.Exercise output indexing and preload admission
packages/db/tests/conformance/*,packages/db/tests/query/custom-index-order-selection-oracle.test.ts,packages/db/tests/live-query-options.test.ts,packages/db/tests/live-query-preload-indexing-oracle.test.ts,packages/{angular,preact,react,solid,svelte,vue}-db/tests/*Core tests check output indexing, ordered reads, source updates, pooled-query configuration, and preload admission. Framework drivers register Basic and B-tree index constructors and run the indexing scenarios. Qualify React Suspense collection reuse
packages/react-db/src/*,packages/react-db/tests/*,packages/db/tests/live-query-cache-options-oracle.tsSuspense cache lookup uses source identity and normalized output options. Tests cover collection sharing, retained settings, option references, and client-scoped caches. Document indexing and cache rules
docs/guides/live-queries.md,docs/framework/react/overview.md,docs/contributing/oracle-coverage.md,docs/contributing/oracle-reviews/*,.changeset/live-query-output-indexing.mdDocumentation describes indexing configuration, pooling constraints, Suspense option retention, preload validation, and recorded test coverage. The changeset declares patch releases for @tanstack/dband@tanstack/react-db.Estimated code review effort: 4 (Complex) | ~35 minutes
Severity of issue fixed: Medium
Sequence Diagram(s)#
sequenceDiagram participant Binding as React Suspense binding participant Key as Suspense key generation participant Cache as Suspense collection cache Binding->>Key: Provide prepared sources and output options Key->>Cache: Look up source identity and normalized options Cache-->>Binding: Reuse matching Collection or create onePossibly related issues
- TanStack/db#2292: The change adds and forwards the live-query indexing settings requested by this issue.
Merge Risk:
Minimal · up toa0d2c-
No actionable issue in the selected changes prevents merging after normal checks.
Pre-merge checks:
4 · 1-
Failed checks: 1 warningCheck name Status Explanation Resolution Docstring Coverage Docstring coverage is 23.53% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold. Passed checks: 4 passed-
Check name Status Explanation Title check The title "fix(db): allow indexing on live-query Collections" matches the main change in the changeset. The PR adds autoIndexanddefaultIndexTypeto live-query Collection configuration, which all…Linked Issues check Issue #2292requires live-query Collection and hook configurations to acceptautoIndexanddefaultIndexTypeand forward them to the output Collection.LiveQueryCollectionConfigdeclares both opt…Out of Scope Changes check The production changes support the #2292API. Preload validation, React Suspense option compatibility, framework conformance updates, documentation, oracle tests, and the patch changeset verify or doc…Description check The description follows the required structure and provides detailed change scope, oracle coverage, test evidence, release impact, known limits, and changeset information. The checklist does not expli… Full details: Title check
-
Explanation
The title "fix(db): allow indexing on live-query Collections" matches the main change in the changeset. The PR adds
autoIndexanddefaultIndexTypeto live-query Collection configuration, which allows indexing on live-query output Collections. The title names the scope (db, live-query Collections) and the action, and it omits the React Suspense sharing rules, the preload validation, and the pooling constraints. Those are secondary to the main change.
Full details: Linked Issues check
-
Explanation
Issue
#2292requires live-query Collection and hook configurations to acceptautoIndexanddefaultIndexTypeand forward them to the output Collection.LiveQueryCollectionConfigdeclares both options,CollectionConfigBuilder.getConfig()forwards them, and conformance tests cover automatic indexing, manual index types, downstream ordered reads, rejection of eager indexing without a constructor, and unchanged source indexing. The issue's inheritance alternatives and benchmark are not coding requirements.
Full details: Out of Scope Changes check
-
Explanation
The production changes support the
#2292API. Preload validation, React Suspense option compatibility, framework conformance updates, documentation, oracle tests, and the patch changeset verify or document the new indexing behavior and its cache semantics. No demonstrated unrelated production change appears in the reviewed scope.
Full details: Description check
-
Explanation
The description follows the required structure and provides detailed change scope, oracle coverage, test evidence, release impact, known limits, and changeset information. The checklist does not explicitly state that
pnpm testwas run, but it documents equivalent targeted test and validation commands, so this is a non-critical omission.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 23.53% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 17 functions across 25 files. (2 skipped: 2 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Incremental update benchmark#
Comparing
36b92daff(this PR) against85392bd1d(base). Write times are per-write medians over 100 iterations (20 warmup writes). Cold hydrate is one timed first load of each query.Overall median write time vs base: 1.01× · cold hydrate time: 1.05× (geometric mean of per-case ratios; lower is faster).
Writes: 3 regression(s), 2 improvement(s) (threshold: ±20% and >0.05ms).
Cold hydrate: 3 regression(s), 0 improvement(s) (threshold: ±50% and >5ms).
Per-case flags are noisy on shared runners. Read the geometric means first.Writes#
Query Δ median write time (geomean) Best case Worst case Flags list: newest 50 open -1.1% -10.1% +30.2% — list + author -1.7% -6.4% +15.3% — list + comment count +10.3% -8.2% +58.9% 3 🔴 list + 3 recent comments -0.6% -25.5% +30.7% 1 🟢 issue detail + comments +0.2% -31.1% +23.4% 1 🟢 Cold hydrate#
Query Δ cold hydrate time (geomean) Best case Worst case Flags list: newest 50 open +4.0% -22.7% +82.5% 1 🔴 list + author +0.4% -32.1% +71.8% 1 🔴 list + comment count -1.0% -36.4% +47.8% — list + 3 recent comments +8.0% -26.6% +195.3% 1 🔴 issue detail + comments +18.6% -14.8% +300.3% — Each row aggregates the 14.4 scale/index/write-mode configurations of that query; per-configuration tables below.
100 rows/collection | source indexes: none | synced writes — geomean 0.94×, cold 1.00×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold list: newest 50 open 0.226ms 0.209ms -7.6% 0.354ms 0.341ms -3.6% 13.610ms 14.043ms +3.2% list: newest 50 open 0.553ms 0.527ms -4.7% 0.943ms 0.881ms -6.6% 4.199ms 4.613ms +9.9% list + author 0.220ms 0.207ms -5.5% 0.369ms 0.334ms -9.4% 10.223ms 8.930ms -12.7% list + comment count 0.354ms 0.344ms -2.9% 0.588ms 0.560ms -4.8% 11.718ms 12.148ms +3.7% list + 3 recent comments 0.259ms 0.233ms -9.9% 0.382ms 0.398ms +4.2% 9.847ms 10.263ms +4.2% issue detail + comments 0.169ms 0.163ms -3.6% 0.230ms 0.282ms +22.6% 1.814ms 1.679ms -7.4% 100 rows/collection | source indexes: none | optimistic writes — geomean 0.98×, cold 1.05×, 1 change(s)
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold list: newest 50 open 0.150ms 0.158ms +5.1% 0.254ms 0.241ms -5.0% 2.021ms 1.671ms -17.3% list: newest 50 open 0.102ms 0.099ms -2.7% 0.180ms 0.187ms +4.3% 1.695ms 1.467ms -13.4% list + author 0.169ms 0.164ms -3.0% 0.292ms 0.284ms -2.6% 3.769ms 4.365ms +15.8% list + comment count 0.239ms 0.236ms -1.1% 0.395ms 0.421ms +6.6% 3.717ms 4.728ms +27.2% list + 3 recent comments 0.142ms 0.186ms +30.7% 0.251ms 0.270ms +7.9% 8.376ms 12.542ms +49.7% issue detail + comments 0.182ms 0.125ms -31.1% 0.314ms 0.242ms -22.8% 🟢 1.282ms 1.111ms -13.3% 100 rows/collection | source indexes: manual | synced writes — geomean 1.02×, cold 1.33×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold list: newest 50 open 0.120ms 0.156ms +30.2% 0.272ms 0.251ms -7.8% 2.809ms 3.340ms +18.9% list: newest 50 open 0.408ms 0.368ms -10.0% 0.781ms 0.648ms -17.0% 1.911ms 3.270ms +71.2% list + author 0.135ms 0.131ms -2.9% 0.263ms 0.246ms -6.7% 2.785ms 2.669ms -4.2% list + comment count 0.250ms 0.249ms -0.6% 0.480ms 0.451ms -6.0% 3.224ms 3.183ms -1.3% list + 3 recent comments 0.166ms 0.167ms +0.4% 0.258ms 0.224ms -13.1% 7.139ms 5.238ms -26.6% issue detail + comments 0.130ms 0.127ms -2.0% 0.247ms 0.213ms -13.8% 0.619ms 2.479ms +300.3% 100 rows/collection | source indexes: manual | optimistic writes — geomean 1.00×, cold 0.95×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold list: newest 50 open 0.110ms 0.111ms +0.6% 0.158ms 0.192ms +21.3% 1.680ms 1.649ms -1.8% list: newest 50 open 0.089ms 0.088ms -1.7% 0.182ms 0.152ms -16.7% 1.050ms 1.015ms -3.3% list + author 0.144ms 0.140ms -2.6% 0.255ms 0.190ms -25.6% 2.455ms 2.351ms -4.2% list + comment count 0.217ms 0.221ms +1.6% 0.352ms 0.351ms -0.4% 4.730ms 3.009ms -36.4% list + 3 recent comments 0.129ms 0.129ms +0.1% 0.208ms 0.189ms -9.3% 5.053ms 4.356ms -13.8% issue detail + comments 0.108ms 0.112ms +3.3% 0.146ms 0.148ms +1.2% 0.408ms 0.600ms +47.0% 1,000 rows/collection | source indexes: none | synced writes — geomean 1.09×, cold 1.18×, 3 change(s)
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold list: newest 50 open 0.084ms 0.084ms -0.2% 0.169ms 0.173ms +2.1% 9.627ms 7.445ms -22.7% list: newest 50 open 1.069ms 1.070ms +0.1% 2.074ms 2.089ms +0.8% 6.856ms 9.093ms +32.6% list + author 0.110ms 0.126ms +15.3% 0.140ms 0.229ms +62.9% 20.871ms 35.863ms +71.8% 🔴 list + comment count 0.211ms 0.335ms +58.9% 0.336ms 0.533ms +58.5% 🔴 14.269ms 18.539ms +29.9% list + 3 recent comments 0.201ms 0.150ms -25.5% 0.353ms 0.242ms -31.3% 🟢 14.969ms 13.514ms -9.7% issue detail + comments 0.161ms 0.199ms +23.4% 0.308ms 0.303ms -1.7% 1.349ms 1.781ms +32.0% 1,000 rows/collection | source indexes: none | optimistic writes — geomean 1.02×, cold 0.98×, 1 change(s)
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold list: newest 50 open 0.109ms 0.117ms +6.7% 0.246ms 0.203ms -17.6% 6.238ms 11.388ms +82.5% 🔴 list: newest 50 open 0.071ms 0.069ms -1.9% 0.141ms 0.096ms -32.2% 6.113ms 5.641ms -7.7% list + author 0.131ms 0.128ms -2.6% 0.223ms 0.224ms +0.5% 23.569ms 23.949ms +1.6% list + comment count 0.214ms 0.196ms -8.2% 0.396ms 0.234ms -40.9% 13.459ms 8.715ms -35.2% list + 3 recent comments 0.110ms 0.122ms +10.8% 0.139ms 0.167ms +20.3% 10.516ms 10.112ms -3.8% issue detail + comments 0.101ms 0.110ms +8.6% 0.127ms 0.138ms +8.1% 1.212ms 1.033ms -14.8% 1,000 rows/collection | source indexes: manual | synced writes — geomean 1.02×, cold 1.00×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold list: newest 50 open 0.081ms 0.080ms -2.2% 0.105ms 0.103ms -2.0% 1.038ms 1.164ms +12.1% list: newest 50 open 0.363ms 0.332ms -8.5% 0.608ms 0.601ms -1.2% 0.816ms 0.807ms -1.2% list + author 0.112ms 0.109ms -3.2% 0.193ms 0.149ms -23.1% 1.948ms 1.822ms -6.5% list + comment count 0.219ms 0.228ms +4.3% 0.377ms 0.385ms +2.1% 2.685ms 2.886ms +7.5% list + 3 recent comments 0.138ms 0.149ms +8.1% 0.173ms 0.178ms +2.8% 5.874ms 5.703ms -2.9% issue detail + comments 0.100ms 0.115ms +15.4% 0.127ms 0.209ms +65.1% 0.453ms 0.409ms -9.9% 1,000 rows/collection | source indexes: manual | optimistic writes — geomean 1.08×, cold 0.94×, 1 change(s)
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold list: newest 50 open 0.095ms 0.096ms +0.7% 0.123ms 0.122ms -0.5% 0.810ms 0.791ms -2.3% list: newest 50 open 0.078ms 0.079ms +1.9% 0.113ms 0.130ms +15.3% 1.021ms 0.873ms -14.5% list + author 0.125ms 0.123ms -1.8% 0.167ms 0.151ms -9.7% 1.970ms 1.843ms -6.4% list + comment count 0.196ms 0.285ms +45.7% 0.246ms 0.371ms +50.7% 🔴 2.726ms 2.713ms -0.5% list + 3 recent comments 0.121ms 0.127ms +4.6% 0.149ms 0.158ms +5.8% 4.765ms 4.108ms -13.8% issue detail + comments 0.107ms 0.110ms +2.7% 0.185ms 0.154ms -16.8% 0.399ms 0.422ms +5.6% 10,000 rows/collection | source indexes: none | synced writes — geomean 1.02×, cold 1.03×, 1 change(s)
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold list: newest 50 open 0.078ms 0.075ms -4.3% 0.138ms 0.138ms -0.2% 72.710ms 68.047ms -6.4% list: newest 50 open 9.712ms 9.788ms +0.8% 10.291ms 10.470ms +1.7% 70.016ms 64.865ms -7.4% list + author 0.177ms 0.165ms -6.4% 0.236ms 0.223ms -5.4% 223.975ms 213.307ms -4.8% list + comment count 0.244ms 0.351ms +43.8% 0.364ms 0.419ms +15.3% 🔴 72.562ms 73.299ms +1.0% list + 3 recent comments 0.151ms 0.136ms -10.2% 0.288ms 0.187ms -35.2% 86.784ms 90.136ms +3.9% issue detail + comments 0.108ms 0.102ms -4.9% 0.137ms 0.130ms -4.8% 6.714ms 9.526ms +41.9% 10,000 rows/collection | source indexes: none | optimistic writes — geomean 0.94×, cold 0.93×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold list: newest 50 open 0.107ms 0.096ms -10.1% 0.198ms 0.165ms -16.7% 67.999ms 63.477ms -6.7% list: newest 50 open 0.070ms 0.064ms -9.6% 0.112ms 0.115ms +3.4% 70.736ms 62.393ms -11.8% list + author 0.127ms 0.120ms -5.3% 0.162ms 0.167ms +3.0% 213.967ms 201.892ms -5.6% list + comment count 0.225ms 0.220ms -2.1% 0.261ms 0.271ms +3.8% 81.023ms 72.321ms -10.7% list + 3 recent comments 0.121ms 0.117ms -3.4% 0.150ms 0.144ms -4.0% 72.416ms 70.837ms -2.2% issue detail + comments 0.114ms 0.110ms -3.9% 0.148ms 0.143ms -3.1% 5.328ms 5.118ms -3.9% 10,000 rows/collection | source indexes: manual | synced writes — geomean 0.98×, cold 1.29×, 1 change(s)
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold list: newest 50 open 0.081ms 0.075ms -6.8% 0.104ms 0.100ms -3.8% 1.781ms 1.727ms -3.0% list: newest 50 open 0.996ms 0.995ms -0.1% 1.609ms 1.420ms -11.8% 3.368ms 2.739ms -18.7% list + author 0.112ms 0.111ms -0.9% 0.145ms 0.209ms +43.8% 3.570ms 4.340ms +21.6% list + comment count 0.220ms 0.219ms -0.3% 0.249ms 0.270ms +8.4% 3.983ms 5.886ms +47.8% list + 3 recent comments 0.156ms 0.145ms -7.2% 0.284ms 0.176ms -38.2% 5.572ms 16.453ms +195.3% 🔴 issue detail + comments 0.116ms 0.120ms +4.1% 0.206ms 0.188ms -9.1% 0.614ms 0.682ms +11.0% Runner: node v24.8.0, linux 7.0.0-1017-azure, AMD EPYC 7763 64-Core Processor. Timings on shared CI runners are noisy; treat small deltas as indicative only.10,000 rows/collection | source indexes: manual | optimistic writes — geomean 1.03×, cold 1.05×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold list: newest 50 open 0.103ms 0.110ms +7.4% 0.130ms 0.213ms +63.6% 1.698ms 2.847ms +67.7% list: newest 50 open 0.084ms 0.082ms -2.0% 0.114ms 0.111ms -2.9% 1.598ms 1.719ms +7.6% list + author 0.130ms 0.130ms -0.2% 0.224ms 0.171ms -23.7% 5.124ms 3.478ms -32.1% list + comment count 0.241ms 0.259ms +7.6% 0.286ms 0.463ms +62.3% 3.866ms 3.453ms -10.7% list + 3 recent comments 0.135ms 0.141ms +4.5% 0.166ms 0.217ms +31.0% 4.583ms 5.376ms +17.3% issue detail + comments 0.120ms 0.120ms +0.4% 0.157ms 0.151ms -4.1% 0.580ms 0.590ms +1.6% Size Change: -59 B (-0.02%)
Total Size: 238 kB
📦 View Changed
Filename Size Change packages/db/dist/esm/client.js5.51 kB +27 B (+0.49%) packages/db/dist/esm/collection/index.js6.23 kB -92 B (-1.46%) packages/db/dist/esm/collection/validate-indexing.js366 B +366 B (new file) 🆕 packages/db/dist/esm/query/live/collection-config-builder.js8.54 kB +21 B (+0.25%) packages/react-db/dist/esm/live-query-internals.js0 B -282 B (removed) 🏆 packages/react-db/dist/esm/useLiveInfiniteQuery.js1.45 kB -10 B (-0.69%) packages/react-db/dist/esm/useLiveQuery.js3 kB -44 B (-1.45%) packages/react-db/dist/esm/useLiveSuspenseQuery.js1.32 kB -45 B (-3.31%) compressed-size-action::db-and-react-package-sizeℹ️ View Unchanged
Filename Size packages/db/dist/esm/collection-options-brand.js219 B packages/db/dist/esm/collection-options.js258 B packages/db/dist/esm/collection/change-events.js1.76 kB packages/db/dist/esm/collection/changes.js3.06 kB packages/db/dist/esm/collection/cleanup-queue.js828 B packages/db/dist/esm/collection/config-errors.js547 B packages/db/dist/esm/collection/events.js504 B packages/db/dist/esm/collection/health-tree.js698 B packages/db/dist/esm/collection/indexes.js2.3 kB packages/db/dist/esm/collection/lifecycle.js5.59 kB packages/db/dist/esm/collection/mutations.js2.94 kB packages/db/dist/esm/collection/state.js7.69 kB packages/db/dist/esm/collection/subscription.js9.86 kB packages/db/dist/esm/collection/sync.js6.51 kB packages/db/dist/esm/collection/validate-config.js1.17 kB packages/db/dist/esm/deferred.js207 B packages/db/dist/esm/error-message.js642 B packages/db/dist/esm/errors.js7.15 kB packages/db/dist/esm/event-emitter.js1.06 kB packages/db/dist/esm/index.js4.75 kB packages/db/dist/esm/indexed-db-wrapper.js1.91 kB packages/db/dist/esm/indexed-db.js3.8 kB packages/db/dist/esm/indexes/auto-index.js924 B packages/db/dist/esm/indexes/base-index.js1.92 kB packages/db/dist/esm/indexes/basic-index.js1.93 kB packages/db/dist/esm/indexes/btree-index.js1.62 kB packages/db/dist/esm/indexes/index-registry.js916 B packages/db/dist/esm/indexes/reverse-index.js1.01 kB packages/db/dist/esm/live-query-adapter.js845 B packages/db/dist/esm/live-query-observer-client.js2.21 kB packages/db/dist/esm/live-query-observer.js3.3 kB packages/db/dist/esm/live-query-options.js2.19 kB packages/db/dist/esm/live-query-primitives.js406 B packages/db/dist/esm/live-query-window-binding.js1.56 kB packages/db/dist/esm/live-query-window-controller.js4.02 kB packages/db/dist/esm/local-only.js1 kB packages/db/dist/esm/local-storage.js4.58 kB packages/db/dist/esm/optimistic-action.js359 B packages/db/dist/esm/paced-mutations.js1.11 kB packages/db/dist/esm/proxy.js3.51 kB packages/db/dist/esm/query/builder/clone-query.js854 B packages/db/dist/esm/query/builder/functions.js1.61 kB packages/db/dist/esm/query/builder/group-keys.js157 B packages/db/dist/esm/query/builder/include-functions.js229 B packages/db/dist/esm/query/builder/index.js7.72 kB packages/db/dist/esm/query/builder/query-ir.js312 B packages/db/dist/esm/query/builder/ref-proxy-identity.js292 B packages/db/dist/esm/query/builder/ref-proxy.js1.67 kB packages/db/dist/esm/query/builder/wrapper-identity.js221 B packages/db/dist/esm/query/compiler/evaluators.js2.51 kB packages/db/dist/esm/query/compiler/expressions.js603 B packages/db/dist/esm/query/compiler/find-aggregate.js328 B packages/db/dist/esm/query/compiler/group-by.js4.38 kB packages/db/dist/esm/query/compiler/grouping.js161 B packages/db/dist/esm/query/compiler/index.js10.7 kB packages/db/dist/esm/query/compiler/joins.js3.42 kB packages/db/dist/esm/query/compiler/lazy-targets.js1.11 kB packages/db/dist/esm/query/compiler/order-by.js2.8 kB packages/db/dist/esm/query/compiler/parent-routes.js319 B packages/db/dist/esm/query/compiler/query-equivalence.js568 B packages/db/dist/esm/query/compiler/route-metadata.js1.24 kB packages/db/dist/esm/query/compiler/select.js1.66 kB packages/db/dist/esm/query/effect.js5.79 kB packages/db/dist/esm/query/equality-conjunct.js486 B packages/db/dist/esm/query/equality-value-identity.js736 B packages/db/dist/esm/query/expression-helpers.js1.61 kB packages/db/dist/esm/query/ir-stable-identity.js4.29 kB packages/db/dist/esm/query/ir.js2.26 kB packages/db/dist/esm/query/join-conditions.js257 B packages/db/dist/esm/query/live-query-collection.js391 B packages/db/dist/esm/query/live/bucket-facade-adapter.js3.17 kB packages/db/dist/esm/query/live/collection-registry.js264 B packages/db/dist/esm/query/live/collection-subscriber.js2.68 kB packages/db/dist/esm/query/live/graph-scheduler.js305 B packages/db/dist/esm/query/live/includes-runtime.js212 B packages/db/dist/esm/query/live/internal.js145 B packages/db/dist/esm/query/live/materialized-pipeline.js1.94 kB packages/db/dist/esm/query/live/ordered-source-loader.js6.52 kB packages/db/dist/esm/query/live/public-key-reduction.js970 B packages/db/dist/esm/query/live/subset-demand-controller.js2.44 kB packages/db/dist/esm/query/live/utils.js1.35 kB packages/db/dist/esm/query/optimizer.js2.95 kB packages/db/dist/esm/query/pooled-live-query.js5.14 kB packages/db/dist/esm/query/pooled-source.js219 B packages/db/dist/esm/query/query-once.js359 B packages/db/dist/esm/query/runtime-reference-identity.js630 B packages/db/dist/esm/query/subset-dedupe.js493 B packages/db/dist/esm/scheduler.js1.23 kB packages/db/dist/esm/SortedMap.js1.77 kB packages/db/dist/esm/strategies/commit-completion.js154 B packages/db/dist/esm/strategies/debounceStrategy.js658 B packages/db/dist/esm/strategies/queueStrategy.js523 B packages/db/dist/esm/strategies/serial-pacer.js486 B packages/db/dist/esm/strategies/throttleStrategy.js738 B packages/db/dist/esm/sync-persistence.js669 B packages/db/dist/esm/sync-receipt.js211 B packages/db/dist/esm/transaction-commit-work.js351 B packages/db/dist/esm/transactions.js4.66 kB packages/db/dist/esm/utils.js1.7 kB packages/db/dist/esm/utils/array-utils.js270 B packages/db/dist/esm/utils/browser-polyfills.js304 B packages/db/dist/esm/utils/btree.js3.02 kB packages/db/dist/esm/utils/callbacks.js219 B packages/db/dist/esm/utils/comparison.js1.95 kB packages/db/dist/esm/utils/cursor.js753 B packages/db/dist/esm/utils/error.js262 B packages/db/dist/esm/utils/get-or-create.js155 B packages/db/dist/esm/utils/index-optimization.js2.58 kB packages/db/dist/esm/utils/source-record.js140 B packages/db/dist/esm/utils/type-guards.js230 B packages/db/dist/esm/utils/uuid.js530 B packages/db/dist/esm/virtual-props.js400 B packages/react-db/dist/esm/DbProvider.js317 B packages/react-db/dist/esm/development.js190 B packages/react-db/dist/esm/HydrationBoundary.js263 B packages/react-db/dist/esm/index.js330 B packages/react-db/dist/esm/source-id-bindings.js339 B packages/react-db/dist/esm/useLiveQueryEffect.js504 B packages/react-db/dist/esm/usePacedMutations.js429 B More templates
- todos
- offline-first-electron
- @tanstack/db-example-react-action-enforcement
- @tanstack/db-example-react-next-ssr-e2e
- tanstack-start-example-basic
- @tanstack/db-example-paced-mutations-demo
- tanstack-start-db-projects-example
- @tanstack/db-example-react-start-ssr-e2e
- @tanstack/db-example-react-todo
- offline-transactions-react-native
- shopping-list-react-native
- @tanstack/db-example-solid-todo
@tanstack/angular-db
npm i https://pkg.pr.new/@tanstack/angular-db@2314@tanstack/browser-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/browser-db-sqlite-persistence@2314@tanstack/capacitor-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/capacitor-db-sqlite-persistence@2314@tanstack/cloudflare-durable-objects-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/cloudflare-durable-objects-db-sqlite-persistence@2314@tanstack/convex-db-collection
npm i https://pkg.pr.new/@tanstack/convex-db-collection@2314@tanstack/db
npm i https://pkg.pr.new/@tanstack/db@2314@tanstack/db-ivm
npm i https://pkg.pr.new/@tanstack/db-ivm@2314@tanstack/db-sqlite-persistence-core
npm i https://pkg.pr.new/@tanstack/db-sqlite-persistence-core@2314@tanstack/electric-db-collection
npm i https://pkg.pr.new/@tanstack/electric-db-collection@2314@tanstack/electron-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/electron-db-sqlite-persistence@2314@tanstack/expo-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/expo-db-sqlite-persistence@2314@tanstack/node-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/node-db-sqlite-persistence@2314@tanstack/offline-transactions
npm i https://pkg.pr.new/@tanstack/offline-transactions@2314@tanstack/powersync-db-collection
npm i https://pkg.pr.new/@tanstack/powersync-db-collection@2314@tanstack/preact-db
npm i https://pkg.pr.new/@tanstack/preact-db@2314@tanstack/query-db-collection
npm i https://pkg.pr.new/@tanstack/query-db-collection@2314@tanstack/react-db
npm i https://pkg.pr.new/@tanstack/react-db@2314@tanstack/react-native-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/react-native-db-sqlite-persistence@2314@tanstack/react-router-with-db
npm i https://pkg.pr.new/@tanstack/react-router-with-db@2314@tanstack/rxdb-db-collection
npm i https://pkg.pr.new/@tanstack/rxdb-db-collection@2314@tanstack/solid-db
npm i https://pkg.pr.new/@tanstack/solid-db@2314@tanstack/svelte-db
npm i https://pkg.pr.new/@tanstack/svelte-db@2314@tanstack/tauri-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/tauri-db-sqlite-persistence@2314@tanstack/trailbase-db-collection
npm i https://pkg.pr.new/@tanstack/trailbase-db-collection@2314@tanstack/vue-db
npm i https://pkg.pr.new/@tanstack/vue-db@2314commit:
c9c04f8 Additional comments: 2-
docs/contributing/oracle-coverage.md-1963-1963: 1
-
1963-1963: Minor · Maintainability & Code Quality · Quick win **Unverified finding** Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.Format the
queryKeyidentifier as code.queryKeyis an API identifier, not an English word. Write it as`queryKey`to preserve the identifier and avoid the spelling diagnostic.Source: Linters/SAST tools
docs/contributing/oracle-reviews/2026-10-30-pr-2314-high-effort-review.md-25-25: 1
-
25-25: Minor · Maintainability & Code Quality · Quick win **Unverified finding** Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.Hyphenate
non-React-focused.Use
non-React-focusedin this sentence. The current wording is difficult to parse and is reported by the configured grammar check.Source: Linters/SAST tools
-
Review info-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
21f44a11-4a65-466f-a493-12f311bfd0b5
Commits-
Reviewing files that changed from the base of the PR and between f2c51186921b2a863b0ccd5bfb065b5402650260 and 80985a1ab99c5573fe66dc9d894f575188dbf45c.
Files selected for processing: 20-
.changeset/live-query-output-indexing.mddocs/contributing/oracle-coverage.mddocs/contributing/oracle-reviews/2026-10-30-pr-2314-high-effort-review.mddocs/framework/react/overview.mddocs/guides/live-queries.mdpackages/db/src/client.tspackages/db/src/collection/index.tspackages/db/src/collection/validate-indexing.tspackages/db/tests/conformance/indexing-config-oracle.tspackages/db/tests/conformance/indexing-reuse-oracle.test.tspackages/db/tests/fixtures/error-site-messages.jsonpackages/db/tests/live-query-cache-options-oracle.tspackages/db/tests/live-query-options.test.tspackages/db/tests/live-query-preload-indexing-oracle.test.tspackages/db/tests/query/custom-index-order-selection-oracle.test.tspackages/react-db/src/live-query-internals.tspackages/react-db/src/useLiveQuery.tspackages/react-db/tests/cache-options-oracle.test.tsxpackages/react-db/tests/suspense-indexing-config-oracle.test.tsxpackages/react-db/tests/suspense-local-options-oracle.test.tsx
Files skipped from review as they are similar to previous changes: 1-
- .changeset/live-query-output-indexing.md
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
-
-
KyleAMathews(GitHub profile, opens in a new tab) closed this
🎉 This PR has been released!
Backfilled notification for published release candidates.
Sign in to join this conversation.
🦋 Changeset detected#
Latest commit: a22b0c47389febac24ae7b7b2fc623f097c9fed8
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 24 packages
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR