Provide a common Index trait & simplify and shrink TableIndex#3973
Merged
Provide a common Index trait & simplify and shrink TableIndex#3973
Index trait & simplify and shrink TableIndex#3973Conversation
Centril
commented
Jan 8, 2026
gefjon
approved these changes
Jan 8, 2026
b0a8b56 to
299a8d6
Compare
aae6056 to
c98532d
Compare
kistz
pushed a commit
to kistz/SpacetimeDB
that referenced
this pull request
Jan 13, 2026
…ockworklabs#3973) # Description of Changes Provides common traits `Index` and `RangedIndex` that all (current) variants in `TypedIndex` adhere to. This is then used to simplify `TypedIndex` by merging common code, with more simplifications to come later. The responsibility of tracking statistics is also moved into each index type, as some can exploit their properties to provide some statistics for free, rather than storing statistics in fields. # API and ABI breaking changes None # Expected complexity level and risk 2? # Testing This is mostly code motion, so it is covered by existing tests. Further test improvements will come in a follow up PR.
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
Provides common traits
IndexandRangedIndexthat all (current) variants inTypedIndexadhere to.This is then used to simplify
TypedIndexby merging common code,with more simplifications to come later.
The responsibility of tracking statistics is also moved into each index type, as some can exploit their properties to provide some statistics for free, rather than storing statistics in fields.
API and ABI breaking changes
None
Expected complexity level and risk
2?
Testing
This is mostly code motion, so it is covered by existing tests.
Further test improvements will come in a follow up PR.