CASSANDRA-19661: Dynamically skip sharding L0 when SAI Vector index present#4605
Open
michaeljmarshall wants to merge 3 commits intoapache:cassandra-5.0from
Open
CASSANDRA-19661: Dynamically skip sharding L0 when SAI Vector index present#4605michaeljmarshall wants to merge 3 commits intoapache:cassandra-5.0from
michaeljmarshall wants to merge 3 commits intoapache:cassandra-5.0from
Conversation
netudima
reviewed
Feb 10, 2026
src/java/org/apache/cassandra/db/compaction/UnifiedCompactionStrategy.java
Outdated
Show resolved
Hide resolved
(cherry picked from commit 94406f3)
netudima
approved these changes
Feb 17, 2026
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.
This is a partial solution to https://issues.apache.org/jira/browse/CASSANDRA-19661. It works by using a single shard at L0 when a vector index is present. As noted in the jira ticket, there are edge cases that may still produce errors, notably the case where there are multiple data directories.
The key trade offs here are related to the time complexity for search. Since graph search is
log(n), and searching m graphs ism * log(n), we see better search performance by building bigger graphs which is essentiallylog(m * n). We could pre-shard, which comes at a cost of increased search time complexity.