Repository navigation
perf(query): skip Sort for proven committed input order (#641, 1/3) - #778
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This was referenced Oct 28, 2026
This was referenced Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A value-only
:order-byquery currently scans its whole input through Sort even under a small limit. This resolves conservative order proofs against the query's pinned reader, selects AVET where appropriate, and omits Sort while restoring its projection slots. Entity-and-attribute ranges retain EAVT.Only a single committed integer, float, or Boolean kind qualifies, including history. Range-local pending/staged records, incomplete tie order, order-changing steps, callbacks and
collect-setretain the original plan. Optional proof failures fall back. A zero limit performs no proof reads, including with an offset.Docs-site companion: project-minigraf/minigraf-docs#80.
Refs #641, slice 1 of 3. Grouped Aggregate and partition Window remain subsequent slices; keep the issue open.
Type of change
Checklist
cargo testpasses (bench: default 1,926 passing; test-hooks 1,959)cargo fmt --checkpassesunwrap()/expect()in library code pathsCHANGELOG.mdupdated underUnreleasedNotes for reviewer
Bench evidence: method and tables, with all 504 A/B records and source fingerprints. At the nominal 10M scale, ordered limit falls from 643.947 ms to 0.463 ms; 10M/100K latency is 1.012x, with 12 KiB extra peak RSS. All exact #379 guards remain within 5% (worst +1.39%).
Startup tradeoff: a one-row ordered entity lookup increases from about 21 µs to 117 µs because it still performs eight whole-attribute proof seeks. This is recorded separately from the ordinary point guards.
All unchanged coverage floors pass (95.39% lines / 86.14% branches); 12 Kani harnesses pass; WASI has 1,177 passing tests and a release REPL build; Firefox has 59 passing browser tests including a committed optimized fixture. Chrome is covered by PR CI. The release binary is 1,254,928 bytes under the unchanged 1,259,520-byte cap; shared existing sort comparators remove duplicate generated code. Claude independently reviewed the spec, plan, code and evidence.