Repository navigation
perf(query): stream certified count groups (#641) - #779
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
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.
Ordered grouped
countandcount-distinctnow release completed groups instead of retaining every group. The snapshot proof admits one integer/Boolean/committed-float key (including mixed integer/float grouping), with no:with, windows, callbacks orcollect-set. Fallible aggregates keep full-drain validation and existing error/drop-group precedence. A unique single-kind group key can omit the final ascending Sort; mixed numeric keys keep numeric sorting.Depends on #778. This is slice 2 of #641; the issue stays open for partition windows. Companion docs: minigraf-docs #81.
At 10M committed rows in fixed groups of 16, full count is 33.41% faster and distinct count 40.25% faster. Ordered limit-10 queries take about 0.64–0.76 ms, with 10M/100K ratios of 0.988/0.994. Meter peaks stay at 480/1,120 bytes with one active group and 1,024 input reads under the limit; maximum RSS growth over 100K is 152 KiB. All 252 six-round grouped records are retained.
The single-growing-group control is explicit: distinct members still grow, count is 11.14–13.33% slower and distinct count 5.49–8.38% slower. A one-row selective grouped query rises from about 23–25 µs to 119–135 µs because of eight proof seeks (72 additional retained startup records). There is no cost-based strategy selection. Passing batches follow existing uncharged accounting; active groups, distinct members and finish scratch are charged, with no retained batch or finished-results list between calls. Internal child pulls evict DICT lookups; a targeted regression fails if that eviction is removed.
Validation on the bench: 1,947 default / 1,980 test-hooks passing; unchanged coverage floors pass (95.40% lines / 86.38% branches); strict native/browser/WASI clippy; WASI 1,179 passing and Firefox 60 passing; WASI release build; updated million-group acceptance; all 16
query/ordered_groupsCriterion IDs executed and selected by the existing nightly^query/route. The appended native cache test passed filtered default/hooks and incremental coverage checks; the production library stayed byte-identical. Frozen answers are unchanged. The release binary is 1,259,368 bytes against the unchanged 1,259,520-byte cap.All 12 exact #379 history guards pass (worst +0.68%); ordinary envelope point deltas are −1.16% to +1.60%. All 360 envelope/control and 144 history records are retained.
Claude reviewed the spec/plan and code, including the boundary
INT-032safeguard. Claude marked both the combined code/evidence and the selective startup-cost disclosure READY.