Skip to content
Source
Sign inSign up
TanStack/db

fix(db): load includes only for the rows a windowed query shows #2156

MergedKyleAMathews(GitHub profile, opens in a new tab)merged 27 commits intomain fromrefs/pull/2156/headmerged by KyleAMathews(GitHub profile, opens in a new tab)

🎯 Changes

A paginated live query with an include in its select loaded child rows for every parent row before the page. A late page then cost far more than the first page. With distinct, every page loaded children for every source row. This PR makes a windowed query, or a findOne, load includes only for the rows it shows. Closes #2137.

The cost

The issue's benchmark uses 8,000 parents with 3 children each and pages of 10 rows. It counts the child rows that the query loads for one page:

mainThis PR
Page 030 (9 ms)30 (9 ms)
Page 1003,030 (35 ms)30 (7 ms)
Page 40012,030 (77 ms)30 (18 ms)
Page 79924,000 (130 ms)30 (27 ms)
distinct, any page24,000 (150–179 ms)30 (49–67 ms)

The times are rough. The row counts are exact.

Cause and change

The compiler built the include routes from the rows after where, before the ordered window. So every row that the window read got its includes, and the window then dropped most of those rows. With distinct, the window must read the full source, so every row got its includes.

Now a windowed query or a findOne compiles its includes after its own top-K operator. The include routes come from the rows that the top-K operator shows, through the routing tag that each row already carries. A query that is neither windowed nor a findOne keeps the old order.

Related rules changed with this:

  • Static child demand. A where that names correlation values used to start child loads for all of those values at once. Now that happens only when no window can drop those rows. The query must be neither windowed nor a findOne. Or it must be a findOne that shows one row for one named correlation value. Any other window, including one that setWindow requests before start, can drop those rows, so the child loads wait for the rows that the window shows. A detail page (where(eq(id, x)).findOne()) still starts its child load beside its parent load.
  • setWindow ownership. Only the query's own top-K operator answers setWindow. A window in a from subquery, a joined subquery or an include child no longer takes it over.
  • findOne window (breaking). A findOne keeps its compiled limit: 1, or 0 for .limit(0).findOne(). setWindow with a different limit throws the new SetWindowFindOneLimitError. Before, setWindow({ limit: 3 }) made a findOne show three rows. An unordered findOne accepts only offset 0.

ARCHITECTURE.md states the rule and these limits. The changeset releases the change as a minor version.

Evidence

The includes-work oracle (packages/db/tests/query/includes-work-counter-oracle.test.ts) generates these dimensions:

  • Parent forms: a page, findOne, and orderBy with setWindow.
  • Child forms: child query, toArray, materialize, findOne, and ordered, limited and nested children.
  • On-demand child sources and static filters.
  • distinct collisions and ties at the window edge.
  • Window moves before and after start.

At each checkpoint it checks two laws:

  1. The rows equal a relational model.
  2. A step loads only the children of groups that the window newly shows. Preload loads only the children of the shown groups.

Results:

  • On main's compiler, the oracle fails, for example with 120 child rows loaded against a bound of 9.
  • These mutants fail:
    • A router that also sends the row after the window fails 17 tests.
    • A router that sends every row tied with the window edge fails 3 tests.
    • A child that takes over setWindow fails 3 tests.
  • Each round of fixes failed on the previous round's code, at the case that the round added.
  • The full @tanstack/db suite passes: 283 files, 13,274 tests. The oracle passes at 60 times the run count and on four random seeds.
  • Nine review rounds examined this branch. The last round found nothing actionable.
  • Production code: net −9 lines, not counting ARCHITECTURE.md.

Limits

  • #2151: while the parent's ordered loader refills, the top-K operator can briefly hold a row that it does not show after the refill. That row's children load. The published rows stay right. Pinned replays allow the observed one extra row, and the generated bound skips only those checkpoints.
  • Includes inherited from a from subquery, and the inputs of fn.select, still load for every row before the window.
  • Only pinned cases catch the edge tie-group mutant, not the generated campaigns.
  • A child compile that fails still leaves the auto-index that the parent's orderBy created.

✅ Checklist

  • I have tested this code locally with pnpm test.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.

This pull request and its description were written by Isaac.

Summary by CodeRabbit

  • Behavior Changes
    • Live-query includes on windowed queries load only for rows shown in the window. Includes inherited from a subquery or passed to fn.select retain their previous loading behavior.
    • setWindow() can move an ordered findOne window without changing its compiled limit. Unordered findOne remains fixed at offset 0, and its limit cannot be changed.
    • Queries without the required ordering or include routes now report errors.
  • Documentation
    • Updated guidance and error references for include loading and window behavior.
    1. 🦋 Changeset detected

      Latest commit: b1ee50855c8abcee7ae55023e841de48243c071e

      The changes in this PR will be included in the next version bump.

      This PR includes changesets to release 29 packages
      NameType
      @tanstack/dbMinor
      @tanstack/angular-dbPatch
      @tanstack/capacitor-db-sqlite-persistence-e2e-appPatch
      @tanstack/db-sqlite-persistence-corePatch
      @tanstack/electric-db-collectionPatch
      @tanstack/expo-db-sqlite-persistence-e2e-appPatch
      @tanstack/offline-transactionsPatch
      @tanstack/powersync-db-collectionPatch
      @tanstack/query-db-collectionPatch
      @tanstack/react-dbPatch
      @tanstack/rxdb-db-collectionPatch
      @tanstack/solid-dbPatch
      @tanstack/svelte-dbPatch
      @tanstack/tauri-db-sqlite-persistence-e2e-appPatch
      @tanstack/trailbase-db-collectionPatch
      @tanstack/vue-dbPatch
      todosPatch
      offline-transactions-react-nativePatch
      shopping-list-react-nativePatch
      @tanstack/db-example-react-next-ssr-e2ePatch
      @tanstack/db-example-paced-mutations-demoPatch
      @tanstack/browser-db-sqlite-persistencePatch
      @tanstack/capacitor-db-sqlite-persistencePatch
      @tanstack/cloudflare-durable-objects-db-sqlite-persistencePatch
      @tanstack/electron-db-sqlite-persistencePatch
      @tanstack/expo-db-sqlite-persistencePatch
      @tanstack/node-db-sqlite-persistencePatch
      @tanstack/react-native-db-sqlite-persistencePatch
      @tanstack/tauri-db-sqlite-persistencePatch

      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

    2. Review in Change Stack →

      Important

      Review skipped

      Review was skipped as selected files did not have any reviewable changes.

      ⚙️ Run configuration
      • Configuration used: defaults
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: f3a7e6ca-17bf-42aa-8a13-e76f0f7f682f
      📥 Commits

      Reviewing files that changed from the base of the PR and between d04e58f95b587ac4b158b99ccdcbd527bf373212 and b1ee50855c8abcee7ae55023e841de48243c071e.

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration
      • Configuration used: defaults
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: 816d0bf8-d866-4b6c-b84e-d6e25f9c886b
      📥 Commits

      Reviewing files that changed from the base of the PR and between e2221532e8aa2b91762da7ae8aa511b4004c1958 and d04e58f95b587ac4b158b99ccdcbd527bf373212.

      📒 Files selected for processing: 1
      • scripts/test-minified-db.mjs

      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

      The query compiler now routes includes for windowed and single-result queries from selected rows. Live-query window configuration enforces findOne limit and offset rules. The changes add errors, documentation, and oracle tests for these behaviors.

      Changes: Windowed query include routing

      Layer / File(s)Summary
      Top-K include routing
      packages/db/src/query/compiler/index.ts, packages/db/src/query/live/ARCHITECTURE.md, packages/db/tests/query/includes-work-counter-oracle.test.ts, packages/db/tests/oracle-config.ts, docs/contributing/oracle-coverage.md, .changeset/route-includes-from-window.md
      The compiler defers includes that depend on top-K rows and derives their routes from selected window rows. Oracle tests cover include results and work across windows, query forms, histories, and child sources. Documentation records tested cases and known exceptions.
      findOne window rules and errors
      packages/db/src/query/live/collection-config-builder.ts, packages/db/src/errors.ts, packages/db/tests/query/includes-work-counter-oracle.test.ts, packages/db/tests/query/live-query-collection.test.ts, packages/db/tests/error-sample-arguments.ts, packages/db/tests/fixtures/*, scripts/test-minified-db.mjs, docs/errors.md, docs/reference/classes/SetWindowFindOneLimitError.md, docs/reference/index.md, docs/reference/type-aliases/LiveQueryCollectionUtils.md
      findOne uses a compiled limit capped at 1, including a limit of 0. Ordered findOne can move its offset without changing that limit; unordered findOne stays at offset 0. New and updated errors describe unsupported window changes.

      Priority: ➖ Normal

      Estimated code review effort: 4 (Complex) | ~60 minutes

      Change: Bug fix · Severity of issue fixed: Medium

      Merge Risk: ⚪ Minimal · up to d04e5

      This change adds the new findOne window error to minified-build checks; no merge-blocking risk is evident in the supplied scope.

      Pre-merge checks: Passed 3 · Failed 2
      Failed Failed checks: 2 warnings
      Check nameStatusExplanationResolution
      Linked Issues checkWarning[#2137] The PR routes direct select includes from rows shown by the query's own top-K operator. The oracle and reported benchmark cover paginated and distinct queries. However, the PR also documen…Prevent include loading for transient top-K rows outside the active limit/offset window, or otherwise provide a code path that preserves the strict #2137 work bound. Add regression coverage for the refill case.
      Docstring CoverageWarningDocstring coverage is 47.37% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 8 files.Write docstrings for the functions missing them to satisfy the coverage threshold.
      Passed Passed checks: 3 passed
      Check nameStatusExplanation
      Title checkPassedThe title is concise and clearly states the main change: includes load only for rows shown by a windowed query.
      Description checkPassedThe description includes the required Changes, Checklist, and Release Impact sections. It explains the motivation, implementation, testing, limits, and changeset status in sufficient detail.
      Out of Scope Changes checkPassedThe changes remain connected to [#2137]. Compiler routing, static child-demand timing, query-owned setWindow, findOne limits, error handling, architecture documentation, release metadata, and focu…
      Full details: Linked Issues check

      Explanation

      [#2137] The PR routes direct select includes from rows shown by the query's own top-K operator. The oracle and reported benchmark cover paginated and distinct queries. However, the PR also documents that an index-backed top-K refill can temporarily hold a row outside the active window and load that row's children. That behavior violates #2137's requirement that includes run only for rows inside the limit/offset window.

      ✨ Finishing Touches: 💡 1
      📝 Generate docstrings: 💡
      • Commit to this branch
      • Create a new PR
      🧪 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.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    3. Incremental update benchmark

      Comparing 7afe9313 (this PR) against 8660cc0e (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.02× · cold hydrate time: 0.87× (geometric mean of per-case ratios; lower is faster).

      Writes: 2 regression(s), 3 improvement(s) (threshold: ±20% and >0.05ms).

      Cold hydrate: 0 regression(s), 8 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 caseWorst caseFlags
      list: newest 50 open+6.0%-20.2%+77.7%1 🔴
      list + author+5.5%-2.8%+24.7%—
      list + comment count-5.7%-40.8%+16.9%2 🟢
      list + 3 recent comments+1.3%-41.9%+104.9%1 🔴 1 🟢
      issue detail + comments+0.9%-8.3%+39.4%—

      Cold hydrate

      QueryΔ cold hydrate time (geomean)Best caseWorst caseFlags
      list: newest 50 open-6.1%-53.3%+21.9%1 🟢
      list + author-5.4%-37.9%+52.0%—
      list + comment count-31.5%-68.3%+23.9%4 🟢
      list + 3 recent comments-23.8%-63.1%+87.3%3 🟢
      issue detail + comments+2.0%-42.9%+36.7%—

      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.93×, cold 0.81×, 1 change(s)
      QueryBase medianPR medianΔ medianBase p95PR p95Δ p95Base coldPR coldΔ cold
      list: newest 50 open0.166ms0.164ms-1.4%0.305ms0.329ms+7.9%13.713ms13.169ms-4.0%
      list: newest 50 open0.583ms0.481ms-17.5%0.910ms0.798ms-12.3%4.673ms2.899ms-38.0%
      list + author0.188ms0.189ms+0.4%0.323ms0.346ms+7.1%11.351ms8.670ms-23.6%
      list + comment count0.390ms0.305ms-21.7%0.650ms0.511ms-21.3%🟢17.210ms10.867ms-36.9%
      list + 3 recent comments0.201ms0.202ms+0.4%0.353ms0.360ms+1.9%9.496ms9.742ms+2.6%
      issue detail + comments0.133ms0.137ms+2.3%0.251ms0.203ms-19.2%1.569ms1.477ms-5.8%
      100 rows/collection | source indexes: none | optimistic writes — geomean 1.01×, cold 0.92×
      QueryBase medianPR medianΔ medianBase p95PR p95Δ p95Base coldPR coldΔ cold
      list: newest 50 open0.113ms0.113ms-0.4%0.208ms0.222ms+6.9%2.118ms1.563ms-26.2%
      list: newest 50 open0.338ms0.323ms-4.5%0.617ms0.588ms-4.7%1.883ms2.098ms+11.5%
      list + author0.135ms0.135ms-0.3%0.248ms0.259ms+4.4%5.096ms3.790ms-25.6%
      list + comment count0.222ms0.198ms-10.8%0.401ms0.364ms-9.3%4.798ms5.943ms+23.9%
      list + 3 recent comments0.116ms0.136ms+17.3%0.223ms0.246ms+10.3%7.682ms5.529ms-28.0%
      issue detail + comments0.136ms0.141ms+3.9%0.200ms0.234ms+17.3%0.741ms0.806ms+8.7%
      100 rows/collection | source indexes: manual | synced writes — geomean 0.98×, cold 0.95×
      QueryBase medianPR medianΔ medianBase p95PR p95Δ p95Base coldPR coldΔ cold
      list: newest 50 open0.111ms0.088ms-20.2%0.166ms0.170ms+2.6%3.156ms3.078ms-2.5%
      list: newest 50 open0.345ms0.357ms+3.7%0.629ms0.626ms-0.5%1.196ms1.127ms-5.8%
      list + author0.107ms0.110ms+2.0%0.242ms0.228ms-5.8%3.960ms2.458ms-37.9%
      list + comment count0.225ms0.223ms-0.9%0.412ms0.466ms+13.2%3.275ms3.375ms+3.1%
      list + 3 recent comments0.143ms0.144ms+0.9%0.274ms0.300ms+9.3%4.650ms4.318ms-7.1%
      issue detail + comments0.101ms0.105ms+3.5%0.231ms0.243ms+5.3%0.440ms0.584ms+32.8%
      100 rows/collection | source indexes: manual | optimistic writes — geomean 1.02×, cold 1.06×
      QueryBase medianPR medianΔ medianBase p95PR p95Δ p95Base coldPR coldΔ cold
      list: newest 50 open0.086ms0.081ms-5.6%0.166ms0.168ms+0.7%0.985ms1.201ms+21.9%
      list: newest 50 open0.252ms0.259ms+2.7%0.466ms0.489ms+5.0%1.105ms1.051ms-4.9%
      list + author0.111ms0.115ms+3.5%0.148ms0.227ms+53.7%3.349ms2.929ms-12.6%
      list + comment count0.167ms0.185ms+10.7%0.254ms0.332ms+30.8%2.583ms2.763ms+7.0%
      list + 3 recent comments0.102ms0.103ms+0.7%0.218ms0.160ms-26.6%4.908ms4.593ms-6.4%
      issue detail + comments0.087ms0.085ms-1.6%0.156ms0.165ms+5.5%0.385ms0.526ms+36.7%
      1,000 rows/collection | source indexes: none | synced writes — geomean 1.14×, cold 0.82×, 2 change(s)
      QueryBase medianPR medianΔ medianBase p95PR p95Δ p95Base coldPR coldΔ cold
      list: newest 50 open0.061ms0.084ms+37.1%0.086ms0.137ms+59.3%9.787ms8.708ms-11.0%
      list: newest 50 open1.004ms0.989ms-1.5%2.001ms1.753ms-12.4%6.627ms6.421ms-3.1%
      list + author0.088ms0.086ms-2.8%0.175ms0.166ms-4.9%20.801ms21.018ms+1.0%
      list + comment count0.290ms0.172ms-40.8%0.407ms0.270ms-33.7%🟢30.184ms14.202ms-52.9%🟢
      list + 3 recent comments0.104ms0.214ms+104.9%0.151ms0.416ms+175.4%🔴25.753ms15.055ms-41.5%
      issue detail + comments0.118ms0.164ms+39.4%0.160ms0.228ms+42.5%1.346ms1.699ms+26.2%
      1,000 rows/collection | source indexes: none | optimistic writes — geomean 1.06×, cold 0.59×, 3 change(s)
      QueryBase medianPR medianΔ medianBase p95PR p95Δ p95Base coldPR coldΔ cold
      list: newest 50 open0.084ms0.141ms+66.9%0.219ms0.178ms-18.6%🔴13.523ms6.319ms-53.3%🟢
      list: newest 50 open1.126ms1.148ms+2.0%1.287ms2.921ms+127.0%6.658ms5.918ms-11.1%
      list + author0.103ms0.114ms+11.3%0.209ms0.210ms+0.7%24.167ms18.979ms-21.5%
      list + comment count0.167ms0.149ms-10.7%0.319ms0.283ms-11.2%28.944ms10.142ms-65.0%🟢
      list + 3 recent comments0.092ms0.085ms-8.2%0.112ms0.163ms+45.4%22.516ms9.240ms-59.0%🟢
      issue detail + comments0.081ms0.075ms-6.9%0.098ms0.099ms+1.1%0.980ms0.918ms-6.3%
      1,000 rows/collection | source indexes: manual | synced writes — geomean 0.97×, cold 0.95×
      QueryBase medianPR medianΔ medianBase p95PR p95Δ p95Base coldPR coldΔ cold
      list: newest 50 open0.059ms0.060ms+1.7%0.074ms0.080ms+7.6%1.042ms1.010ms-3.1%
      list: newest 50 open0.256ms0.264ms+3.0%0.525ms0.525ms-0.1%1.176ms1.174ms-0.2%
      list + author0.083ms0.083ms-0.4%0.111ms0.103ms-7.7%1.977ms1.927ms-2.5%
      list + comment count0.192ms0.184ms-4.5%0.381ms0.234ms-38.7%3.460ms2.626ms-24.1%
      list + 3 recent comments0.119ms0.110ms-7.8%0.176ms0.147ms-16.9%5.208ms5.240ms+0.6%
      issue detail + comments0.084ms0.077ms-8.3%0.101ms0.094ms-6.6%0.359ms0.368ms+2.5%
      1,000 rows/collection | source indexes: manual | optimistic writes — geomean 1.02×, cold 1.00×
      QueryBase medianPR medianΔ medianBase p95PR p95Δ p95Base coldPR coldΔ cold
      list: newest 50 open0.068ms0.070ms+3.2%0.085ms0.090ms+5.9%0.781ms0.765ms-2.1%
      list: newest 50 open0.262ms0.257ms-1.9%0.500ms0.343ms-31.4%0.876ms0.827ms-5.6%
      list + author0.094ms0.117ms+24.7%0.111ms0.202ms+81.6%1.839ms1.973ms+7.3%
      list + comment count0.158ms0.161ms+1.8%0.309ms0.230ms-25.7%2.608ms2.477ms-5.0%
      list + 3 recent comments0.103ms0.094ms-8.8%0.212ms0.124ms-41.5%3.728ms3.674ms-1.4%
      issue detail + comments0.083ms0.079ms-4.8%0.113ms0.105ms-7.0%0.363ms0.401ms+10.3%
      10,000 rows/collection | source indexes: none | synced writes — geomean 1.03×, cold 0.74×, 2 change(s)
      QueryBase medianPR medianΔ medianBase p95PR p95Δ p95Base coldPR coldΔ cold
      list: newest 50 open0.059ms0.104ms+77.7%0.088ms0.134ms+52.3%66.360ms67.304ms+1.4%
      list: newest 50 open10.229ms10.252ms+0.2%10.848ms10.892ms+0.4%66.509ms64.356ms-3.2%
      list + author0.081ms0.086ms+5.9%0.117ms0.121ms+3.2%209.916ms215.911ms+2.9%
      list + comment count0.168ms0.180ms+7.1%0.202ms0.306ms+51.1%265.639ms93.587ms-64.8%🟢
      list + 3 recent comments0.188ms0.109ms-41.9%0.236ms0.220ms-7.2%🟢186.703ms85.223ms-54.4%🟢
      issue detail + comments0.080ms0.082ms+2.3%0.126ms0.119ms-5.7%9.265ms9.303ms+0.4%
      10,000 rows/collection | source indexes: none | optimistic writes — geomean 1.01×, cold 0.65×, 2 change(s)
      QueryBase medianPR medianΔ medianBase p95PR p95Δ p95Base coldPR coldΔ cold
      list: newest 50 open0.072ms0.075ms+3.5%0.143ms0.162ms+13.6%58.013ms65.809ms+13.4%
      list: newest 50 open11.596ms11.317ms-2.4%13.013ms11.971ms-8.0%65.805ms65.504ms-0.5%
      list + author0.098ms0.097ms-0.3%0.136ms0.179ms+31.9%199.281ms194.338ms-2.5%
      list + comment count0.183ms0.185ms+0.8%0.333ms0.235ms-29.6%225.473ms71.539ms-68.3%🟢
      list + 3 recent comments0.090ms0.090ms-0.3%0.109ms0.108ms-1.5%200.267ms73.962ms-63.1%🟢
      issue detail + comments0.079ms0.080ms+2.4%0.101ms0.102ms+0.9%9.067ms5.177ms-42.9%
      10,000 rows/collection | source indexes: manual | synced writes — geomean 1.09×, cold 1.26×
      QueryBase medianPR medianΔ medianBase p95PR p95Δ p95Base coldPR coldΔ cold
      list: newest 50 open0.062ms0.076ms+23.2%0.121ms0.158ms+30.5%2.286ms2.774ms+21.4%
      list: newest 50 open0.892ms0.915ms+2.6%1.471ms1.158ms-21.3%1.640ms1.992ms+21.5%
      list + author0.078ms0.080ms+3.4%0.097ms0.112ms+14.7%2.722ms4.137ms+52.0%
      list + comment count0.167ms0.195ms+16.9%0.190ms0.371ms+94.6%5.068ms5.110ms+0.8%
      list + 3 recent comments0.113ms0.135ms+19.6%0.234ms0.302ms+28.8%4.759ms8.913ms+87.3%
      issue detail + comments0.099ms0.091ms-8.2%0.204ms0.129ms-36.7%0.716ms0.667ms-6.9%
      10,000 rows/collection | source indexes: manual | optimistic writes — geomean 1.03×, cold 0.95×
      QueryBase medianPR medianΔ medianBase p95PR p95Δ p95Base coldPR coldΔ cold
      list: newest 50 open0.089ms0.105ms+18.2%0.174ms0.184ms+5.4%2.048ms1.676ms-18.2%
      list: newest 50 open0.910ms0.897ms-1.4%1.006ms0.961ms-4.5%1.690ms1.668ms-1.3%
      list + author0.092ms0.113ms+22.5%0.126ms0.215ms+70.9%3.880ms5.092ms+31.3%
      list + comment count0.210ms0.208ms-0.7%0.269ms0.251ms-6.8%4.870ms4.539ms-6.8%
      list + 3 recent comments0.121ms0.108ms-11.0%0.222ms0.133ms-39.9%7.071ms5.659ms-20.0%
      issue detail + comments0.097ms0.091ms-5.6%0.179ms0.109ms-39.1%0.599ms0.572ms-4.5%
      Runner: node v24.8.0, linux 6.17.0-1022-azure, Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz. Timings on shared CI runners are noisy; treat small deltas as indicative only.
    4. Size Change: +322 B (+0.15%)

      Total Size: 216 kB

      📦 View Changed
      FilenameSizeChange
      packages/db/dist/esm/errors.js6.53 kB+46 B (+0.71%)
      packages/db/dist/esm/index.js4.51 kB+17 B (+0.38%)
      packages/db/dist/esm/query/compiler/index.js10.3 kB+168 B (+1.66%)
      packages/db/dist/esm/query/live/collection-config-builder.js6.84 kB+91 B (+1.35%)
      ℹ️ View Unchanged
      FilenameSize
      packages/db/dist/esm/client.js4.22 kB
      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.js2.96 kB
      packages/db/dist/esm/collection/cleanup-queue.js901 B
      packages/db/dist/esm/collection/config-errors.js547 B
      packages/db/dist/esm/collection/events.js481 B
      packages/db/dist/esm/collection/index.js5.23 kB
      packages/db/dist/esm/collection/indexes.js2.3 kB
      packages/db/dist/esm/collection/lifecycle.js2.94 kB
      packages/db/dist/esm/collection/mutations.js2.99 kB
      packages/db/dist/esm/collection/state.js7.13 kB
      packages/db/dist/esm/collection/subscription.js8.84 kB
      packages/db/dist/esm/collection/sync.js5.32 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/event-emitter.js1.06 kB
      packages/db/dist/esm/indexed-db-wrapper.js1.91 kB
      packages/db/dist/esm/indexed-db.js3.7 kB
      packages/db/dist/esm/indexes/auto-index.js926 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.js338 B
      packages/db/dist/esm/live-query-observer.js4.8 kB
      packages/db/dist/esm/live-query-options.js1.4 kB
      packages/db/dist/esm/live-query-window-controller.js4.27 kB
      packages/db/dist/esm/local-only.js1.08 kB
      packages/db/dist/esm/local-storage.js3.93 kB
      packages/db/dist/esm/optimistic-action.js359 B
      packages/db/dist/esm/paced-mutations.js1.11 kB
      packages/db/dist/esm/persisted-readiness.js195 B
      packages/db/dist/esm/proxy.js3.51 kB
      packages/db/dist/esm/query/builder/clone-query.js849 B
      packages/db/dist/esm/query/builder/functions.js1.56 kB
      packages/db/dist/esm/query/builder/index.js7.48 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/group-by.js4.48 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.26 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.5 kB
      packages/db/dist/esm/query/effect.js5.26 kB
      packages/db/dist/esm/query/equality-conjunct.js486 B
      packages/db/dist/esm/query/equality-value-identity.js735 B
      packages/db/dist/esm/query/expression-helpers.js1.61 kB
      packages/db/dist/esm/query/ir-stable-identity.js4.2 kB
      packages/db/dist/esm/query/ir.js2.2 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.2 kB
      packages/db/dist/esm/query/live/graph-scheduler.js305 B
      packages/db/dist/esm/query/live/internal.js145 B
      packages/db/dist/esm/query/live/materialized-pipeline.js2.39 kB
      packages/db/dist/esm/query/live/ordered-source-loader.js4.49 kB
      packages/db/dist/esm/query/live/subset-demand-controller.js1.73 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.js4.13 kB
      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.6 kB
      packages/db/dist/esm/strategies/commit-completion.js156 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.js626 B
      packages/db/dist/esm/sync-receipt.js211 B
      packages/db/dist/esm/transaction-commit-work.js351 B
      packages/db/dist/esm/transactions.js4.61 kB
      packages/db/dist/esm/utils.js1.67 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.js174 B
      packages/db/dist/esm/utils/comparison.js1.94 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.43 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.js413 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/live-query-internals.js282 B
      packages/react-db/dist/esm/source-id-bindings.js746 B
      packages/react-db/dist/esm/useLiveInfiniteQuery.js2.15 kB
      packages/react-db/dist/esm/useLiveQuery.js3.34 kB
      packages/react-db/dist/esm/useLiveQueryEffect.js504 B
      packages/react-db/dist/esm/useLiveSuspenseQuery.js1.33 kB
      packages/react-db/dist/esm/usePacedMutations.js401 B
      compressed-size-action::db-and-react-package-size
    5. More templates

      @tanstack/angular-db

      npm i https://pkg.pr.new/@tanstack/angular-db@2156

      @tanstack/browser-db-sqlite-persistence

      npm i https://pkg.pr.new/@tanstack/browser-db-sqlite-persistence@2156

      @tanstack/capacitor-db-sqlite-persistence

      npm i https://pkg.pr.new/@tanstack/capacitor-db-sqlite-persistence@2156

      @tanstack/cloudflare-durable-objects-db-sqlite-persistence

      npm i https://pkg.pr.new/@tanstack/cloudflare-durable-objects-db-sqlite-persistence@2156

      @tanstack/db

      npm i https://pkg.pr.new/@tanstack/db@2156

      @tanstack/db-ivm

      npm i https://pkg.pr.new/@tanstack/db-ivm@2156

      @tanstack/db-sqlite-persistence-core

      npm i https://pkg.pr.new/@tanstack/db-sqlite-persistence-core@2156

      @tanstack/electric-db-collection

      npm i https://pkg.pr.new/@tanstack/electric-db-collection@2156

      @tanstack/electron-db-sqlite-persistence

      npm i https://pkg.pr.new/@tanstack/electron-db-sqlite-persistence@2156

      @tanstack/expo-db-sqlite-persistence

      npm i https://pkg.pr.new/@tanstack/expo-db-sqlite-persistence@2156

      @tanstack/node-db-sqlite-persistence

      npm i https://pkg.pr.new/@tanstack/node-db-sqlite-persistence@2156

      @tanstack/offline-transactions

      npm i https://pkg.pr.new/@tanstack/offline-transactions@2156

      @tanstack/powersync-db-collection

      npm i https://pkg.pr.new/@tanstack/powersync-db-collection@2156

      @tanstack/query-db-collection

      npm i https://pkg.pr.new/@tanstack/query-db-collection@2156

      @tanstack/react-db

      npm i https://pkg.pr.new/@tanstack/react-db@2156

      @tanstack/react-native-db-sqlite-persistence

      npm i https://pkg.pr.new/@tanstack/react-native-db-sqlite-persistence@2156

      @tanstack/react-router-with-db

      npm i https://pkg.pr.new/@tanstack/react-router-with-db@2156

      @tanstack/rxdb-db-collection

      npm i https://pkg.pr.new/@tanstack/rxdb-db-collection@2156

      @tanstack/solid-db

      npm i https://pkg.pr.new/@tanstack/solid-db@2156

      @tanstack/svelte-db

      npm i https://pkg.pr.new/@tanstack/svelte-db@2156

      @tanstack/tauri-db-sqlite-persistence

      npm i https://pkg.pr.new/@tanstack/tauri-db-sqlite-persistence@2156

      @tanstack/trailbase-db-collection

      npm i https://pkg.pr.new/@tanstack/trailbase-db-collection@2156

      @tanstack/vue-db

      npm i https://pkg.pr.new/@tanstack/vue-db@2156

      commit: b1ee508

    6. 🎉 This PR has been released!

      Thank you for your contribution!

Sign in to join this conversation.