forked from apache/cassandra
-
Notifications
You must be signed in to change notification settings - Fork 21
CNDB-15919: Optimize SAI NOT queries, push logic into posting lists #2112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
michaeljmarshall
wants to merge
9
commits into
main
Choose a base branch
from
cndb-15919
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+289
−116
Conversation
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
Checklist before you submit for review
|
There are still some issues to be solved. Namely, dealing with version AA.
25d7f7e to
36fe292
Compare
|
✔️ Build ds-cassandra-pr-gate/PR-2112 approved by ButlerApproved by Butler |
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.



What is the issue
Fixes: https://github.com/riptano/cndb/issues/15919
Test PR: https://github.com/riptano/cndb/pull/15949
What does this PR fix and why was it fixed
In the original implementation for #820, we introduced the
PrimaryKeyMapIteratorto iterate all primary keys in an sstable and then do an anti-join on the result of an equality query. That design works, but requires some additional reads from disk to get primary keys that are unnecessary. We can instead iterate over the segment row ids and do the anti join (or the complement) of the result posting list for each segment. In doing so, we avoid several reads from disk and subsequent comparisons.We will see the largest benefit for low cardinality queries that select then negate many rows because we will skip loading many primary keys. We will also see a benefit when there are clustering columns because we can skip loading larger keys.