Skip to content
Source
Sign inSign up
TanStack/db

Test/progressive nested fastpath bug #1532

Closedibirrer(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/1532/headopened

Showing 6 changed files with 150 additions and 44 deletions (loading 4).

x
0 of 6 viewed, 6 left
75 additions and 42 deletionspackages/db/src/query/compiler/index.tsModified
View file
@@ -25,6 +25,7 @@
} from '../ir.js'
import { ensureIndexForField } from '../../indexes/auto-index.js'
import { inArray } from '../builder/functions.js'
+import { extractEqualityKeys } from '../expression-helpers.js'
import { compileExpression, toBooleanPredicate } from './evaluators.js'
import { processJoins } from './joins.js'
import { containsAggregate, processGroupBy } from './group-by.js'
@@ -38,6 +39,7 @@
IncludesMaterialization,
QueryIR,
QueryRef,
+ Where,
} from '../ir.js'
import type { LazyCollectionCallbacks } from './joins.js'
import type { Collection } from '../../collection/index.js'
@@ -396,67 +398,98 @@
childFromCollection,
​
+ // When the parent query statically constrains the correlation field to
+ // known keys (e.g. `.where(eq(parent.id, 5))`), the child subset can be
+ // loaded eagerly — in parallel with the parent — instead of being