Ordered window filtered through a LEFT-joined subquery requests its full source
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- database
Research direction
Read issue #1909 and trace how ordered windows set requiresFullSource for joined filters, especially the joinedFilterSourceOf path. Compare a collection join with the described single-source subquery join, then add a regression test for the visible-runs example. Done means the subquery join waits on its source as proposed and the relevant tests pass; the issue gives no test file or entry point.
Written by the indexing model from the issue text.
Description
#1909 pages an ordered window whose cross-alias filter goes through exactly one LEFT join to a collection. The same filter through a LEFT join to a subquery that only filters one collection still sets requiresFullSource. An example is the existence check for "has a visible run":
const visibleRuns = new Query()
.from({ run: runs })
.where(({ run }) => not(eq(run.userId, 'admin')))
.select(({ run }) => ({ k: run.seekId }))
.distinct()
q.from({ seek: seeks })
.leftJoin({ visible: visibleRuns }, ({ seek, visible }) => eq(seek.id, visible.k))
.where(({ visible }) => not(isUndefined(visible.k)))
.orderBy(({ seek }) => seek.updatedAt, 'desc')
.limit(10)
The subquery is one collection with no joins, limit, offset or grouping. Its rows are lazy-loaded by key into that collection's source, so the joined-filter gate can wait on that source exactly as for a collection join.
Proposal: treat such a subquery join as a joined filter keyed by the subquery's source (joinedFilterSourceOf). Implemented on 0.15.2 with tests; the full suite passes.
- Dominant language
- TypeScript
- Stars
- 4k
- Forks
- 277
- Avg merge
- 17h 40m
- Merged PRs (30d)
- 223
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from TanStack/db
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Garbage collection cleans up a collection while one of its transactions is still persistingPossibly taken @Nabil372 claimed this 1 day ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
persistedCollectionOptions without a schema can't be passed to createCollection (follow-up to #1452)Open
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Merit-Systems/x402scan#1312 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Native Web
Difficulty 1/5 Under an hour Newbie friendliness 80/100
digitalfabrik/integreat-app#4517 ·
Maintainers usually reply within 2 days
-
TLS guide repeats certs/ in the certificate directoryPossibly taken @maheshrijal claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
prometheus/docs#3156 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
medusajs/dtc-starter#90 ·
Maintainers usually reply within 1 day