Skip to content

perf(sequence): answer ordering and inequality comparisons directly - #10144

Merged
robert3005 merged 3 commits into
developfrom
rk/sequence-compare-ordering
Nov 2, 2026
Merged

robert3005 merged 3 commits into
developfrom
rk/sequence-compare-ordering

Conversation

@robert3005

Copy link
Copy Markdown
Contributor

The compare kernel only handled equality, so every other comparison against a constant materialized the sequence. A sequence is monotonic, so an ordering comparison holds on a prefix or a suffix of rows; the kernel now solves for that boundary in i128 and fills the bit range. Inequality negates the equality answer.

@robert3005 robert3005 added the changelog/performance A performance improvement label Sep 30, 2026
@codspeed

codspeed Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 605 untouched benchmarks
⏩ 1713 skipped benchmarks1


Comparing rk/sequence-compare-ordering (31f598b) with develop (dafc832)

Open in CodSpeed

Footnotes

  1. 1713 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@github-actions

Copy link
Copy Markdown
Contributor

This PR has been marked as stale because it has been open for 14 days with no activity. Please comment or remove the stale label if you wish to keep it active, otherwise it will be closed in 7 days

@github-actions github-actions Bot added the stale This PR is stale and will be auto-closed soon label Oct 14, 2026
@robert3005 robert3005 removed the stale This PR is stale and will be auto-closed soon label Oct 16, 2026
@robert3005
robert3005 force-pushed the rk/sequence-compare-ordering branch from 2fdb5dc to 440ca83 Compare October 29, 2026 22:21
The compare kernel only handled equality, so every other comparison
against a constant materialized the sequence. A sequence is monotonic,
so an ordering comparison holds on a prefix or a suffix of rows; the
kernel now solves for that boundary in i128 and fills the bit range.
Inequality negates the equality answer.

Tests compare every operator against the materialized values for
ascending, descending, constant, single-row, narrow, and past-i64
sequences.

Claude-Session: https://claude.ai/code/session_018upv3gY1moo3ba85gKLqbH
Signed-off-by: Robert Kruszewski <github@robertk.io>
Restore the comments that the previous commit deleted, and explain how
ordered_run counts the rows before the constant, with an example.

Move the integer widening into PValue::as_i128, so that other callers
can use it.

Signed-off-by: Robert Kruszewski <github@robertk.io>
@robert3005
robert3005 force-pushed the rk/sequence-compare-ordering branch from 440ca83 to 31f598b Compare November 2, 2026 16:01
Signed-off-by: Robert Kruszewski <github@robertk.io>
@robert3005
robert3005 enabled auto-merge (squash) November 2, 2026 16:38
@robert3005
robert3005 merged commit ca2d97b into develop Nov 2, 2026
98 of 99 checks passed
@robert3005
robert3005 deleted the rk/sequence-compare-ordering branch November 2, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/performance A performance improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants