Skip to content
Source
Sign inSign up
TanStack/db

perf(db): refill an eager indexed ordered window in bounded work #2055

MergedKyleAMathewsmerged 25 commits intomain fromrefs/pull/2055/headmerged by KyleAMathews

Showing 19 changed files with 206 additions and 0 deletions (loading 16).

x
0 of 19 viewed, 19 left
5 additions and 0 deletions.changeset/eager-ordered-window-repair.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/db': patch
+---
+​
+Refill an ordered, limited live query over an eager, indexed source in bounded work. Before, deleting a visible row or changing a visible row's order value made the source resend every matching row to the query. For example, a 50-row window over 10,000 rows resent about 5,000 rows on each such change. The query now reads only the first rows of the window from the index, when the query orders by one term. On-demand sources, queries with more than one order term, queries that filter on a LEFT-joined source, and queries that need the whole source (an inner join, a function filter, or a custom collation) keep their existing behavior.
5 additions and 0 deletions.changeset/reverse-index-null-order.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/db': patch
+---
+​
+Place null values first in a descending ordered query that uses an ascending index. Before, the query reversed the index and put rows with a null order value after every non-null row, while the documented order, and the same query without an index, put them first.
196 additions and 0 deletionsdocs/contributing/oracle-reviews/perf-ordered-window-repair.mdAdded7 lines can hide code
View file
@@ -0,0 +1,196 @@
+# Eager indexed ordered-window repair oracle review
+​
+Reviewed source head: `ff731ad1c` on `perf-ordered-loader`, with the perf fix
+in `44c90e0ad` and the null-ordering fix in `ff731ad1c`. The base is
+`65992aacd` (`main` with #1650).
+​
+## Contract and evidence
+​