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.
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)].
Contributor
Author
There was a problem hiding this comment.
This should be fixed now in the last commit. There were also some pre-existing bugs on master that I fixed. A proptest is also included for all of this now.
0367d60 to
58644fe
Compare
58644fe to
e649f64
Compare
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.table_index/mod.rsalso includes a bunch of interesting stuff.API and ABI breaking changes
Technically this fixes pre-existing bugs in the handling of
Excludedranges for multi-col indices.Expected complexity level and risk
2?
Testing
order_in_bsatn_is_preservedis now adjusted and enabled to exercise the ordering ofRangeCompatBytesKey.btree_multi_col_range_scans_workis added to check the behavior of range scans on multi-col indices.