Open
Conversation
joshua-spacetime
requested changes
Mar 31, 2026
Collaborator
joshua-spacetime
left a comment
There was a problem hiding this comment.
I think more testing is needed for this patch.
| let suffix_len = suffix_types.len(); | ||
|
|
||
| match &self.idx { | ||
| BTreeBytesKey8(_) => Self::bounds_from_bsatn_bytes_key( |
Collaborator
There was a problem hiding this comment.
Don't we need to handle UniqueBTreeBytesKey* here too?
Comment on lines
+239
to
+243
| pub(super) fn from_bsatn_prefix_and_endpoint( | ||
| prefix: &[u8], | ||
| prefix_types: &[ProductTypeElement], | ||
| endpoint: &[u8], | ||
| range_type: &AlgebraicType, |
Collaborator
There was a problem hiding this comment.
prefix is the fixed (non-range) part of the scan right? But the entire range key itself could still be a prefix of the index? In which case there's an implicit suffix with MIN and MAX bounds that we're omitting which is not correct.
Currently I believe if you have a 3-column index on (u64, u64, u64), prefix=5 and endpoint=1 effectively becomes the range [(5,1,0), (5,1,0)].
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.
Description of Changes
Add support for btree indices where the keys are encoded byte strings for e.g., multi-column indices of no-unbounded-types (arrays and strings) that aren't floats.
The main interesting stuff in this PR is in
bytes_key.rswhich definesRangeCompatBytesKey, a type that is derived fromBytesKey, by converting little-endian encoded integers to big-endian. Signed integers are now also supported, but floats are not.API and ABI breaking changes
None
Expected complexity level and risk
2?
Testing
A proptest
order_in_bsatn_is_preservedis now adjusted and enabled to exercise the ordering ofRangeCompatBytesKey.