Repository navigation
fix(orm): read a wide index union from its probes instead of scanning - #456
Conversation
A compiled index union past MAX_INDEX_UNION_PROBES declined to a full table scan. Give the executor a second option: concatenate the probe ranges when they are provably disjoint and ordered on the index's leading field, so the cap picks merged vs sequential rather than index vs scan. Also drop the compiler-side cap, which refused to compile a union at all for an `in` beside another AND term once the list passed 64 values. Fixes #445
🦋 Changeset detectedLatest commit: cf288a2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c6dd8d244b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…opulation The non-cursor multi-probe branch drops its per-probe bound when a residual filter is present, then collects every probe before applying it. For a common probed value that reads most of the table to answer a one-row page. Read that shape as one ordered union stream instead, so the residual runs in filterWith while rows are pulled and take() counts matches. 400 reads -> 1 on the dense case, at every probe width. Also compare probe bounds in their stored representation when ordering them, matching what _applyFilterToQuery pushes into the range. Addresses review feedback on #456.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f34dc171d3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65002eebdc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: afb94ac15d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
854fc51 to
65002ee
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
P1 closeout receipt for head Local HEAD, fetched PR ref and live PR head match. After publishing, 143 All five review threads are resolved. Fresh helper inventory: 0 unresolved Source-backed dispositions and read-back replies:
Other initial feedback URLs are in the dedicated task-plan ledger. New
Hosted pagination docs rendered successfully. Vercel deployment |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
P1 closeout receipt — final head
Auto release is off. Merge requires this exact receipt/live/fetched/local OID |
🐛 Fixes #445
🧭 Task plan: docs/plans/445-index-union-bounded-on-pipeline-path.md
🟢 90% confidence
✅ Outcome
Wide indexed filters stay index-bounded through
select(), cursor paginationand additional scalar conditions. Limited residual reads stop after enough
matches when the index supplies the requested order.
Above 64 ranges, index-ordered pages read the ranges sequentially. Cross-value
sorting still needs
maxScan. Pages withoutorderByfollow index order;the changeset includes a newest-first paging example.
🏗️ Design
Wide unions concatenate only proven disjoint, ordered leading-field ranges.
Temporal bounds use their stored representation for ordering and overlap
checks. Non-cursor limits use the canonical filtered per-probe reader.
🧪 Verified
bun check: passed, including all eight fixtures and verify/runtime.validate/stale; source mapping,discoverability and generated-copy checks passed directly.
Auto release is disabled for this merge.