feat(array): add sorted membership mask - #9552
Open
aunjgr wants to merge 1 commit into
Open
Conversation
Signed-off-by: bRong Njam <longran1989@gmail.com>
aunjgr
force-pushed
the
benthoscape-sorted-binary-set
branch
from
August 22, 2026 20:03
59c0403 to
1868a4b
Compare
Contributor
|
We have sorted-ness stats which could be used here? |
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
Add vectorized exact-membership masks for validated sorted arrays. Engine integrations can now turn
an ordering proof into bounded binary-search range narrowing plus one linear merge, without scalar
extraction, per-row searches, copied variable-width values, or a temporary hash table.
The operation is useful for sorted set predicates and joins, delete-key application, sorted-run
reconciliation, set operations, dictionary-domain filtering, and exact runtime filters.
Changes
SortedArray,SortedOrder,SortedDirection,SortedNulls, andNullEquality.sorted_membership_maskfor Bool, Primitive, Decimal, Binary, and UTF-8 arrays.decimal physical widths.
search_sortedbenchmark with native i64 and external BinaryView membership.vortex-arraysuite, doctests, pinned-nightly formatting, and strictall-target clippy.
Comparative Results
Median times for one 8,192-row probe chunk:
For the large sparse case, narrowing is about 3x faster than rescanning the member set and 3.3x
faster than one binary search per row. A prebuilt hash set remains about 2x faster to probe, while
its measured construction is about 15x slower. This API is therefore an alternative for existing
sorted state and ordered storage, not a universal replacement for hash membership; integrations
should cost both.
API Changes
AI assistance disclosure: OpenAI Codex was used to help draft the implementation, tests,
benchmark, and PR text. The human author reviewed the result and remains accountable for the
contribution.