CASSANDRA-20086: Use score ordered iterators for ANN search#4615
Open
michaeljmarshall wants to merge 2 commits intoapache:trunkfrom
Open
CASSANDRA-20086: Use score ordered iterators for ANN search#4615michaeljmarshall wants to merge 2 commits intoapache:trunkfrom
michaeljmarshall wants to merge 2 commits intoapache:trunkfrom
Conversation
(cherry picked from commit f2e3411)
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.
(cherry picked from commit f2e3411)
This PR implements the feature proposed in https://issues.apache.org/jira/browse/CASSANDRA-20086.
Motivation
Current ANN search does the following:
LIMIT * numSegments)This flow is both inefficient due to multiple sorts/requeries and can produce invalid results in cases where a row has an update to a vector to a worse score.
The new flow:
This change removes two sort operations. It also fixes all update cases by asserting that a row's position within the score ordered iterator is only valid if the vector cell's materialized value is from the same sstable.
Other minor changes
limittotopkwhere we could gettopk < limitfor limit 1000I plan on completing some basic bench marks next week to demonstrate the value of this change. For now, I am opening this to start to get some reviews.