-
Notifications
You must be signed in to change notification settings - Fork 22
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
CNDB-11655: Limit the number of clauses before optimizing the Plan #1409
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about we adding some unit tests to cover this change ?
Plan#optimize can take a very long time when given plans with thousands of intersected clauses, which can result from using ngram analyzers. Related issue: riptano/cndb#10731. Fixes riptano/cndb#11655
That would be quite tricky, as the only thing it changed is the time to run the code. |
Are you saying that the resulting plan is probably the same ? side question: |
Quality Gate passedIssues Measures |
❌ Build ds-cassandra-pr-gate/PR-1409 rejected by Butler2 new test failure(s) in 2 builds Found 2 new test failures
Found 6 known test failures |
Yes, the resulting plan is likely the same or very similar - generally in either case the intersection clause limit will be applied and at most INTERSECTION_CLAUSE_LIMIT best (most selective) indexes will be chosen; the difference is that now we don't estimate the costs of all queries having more than INTERSECTION_CLAUSE_LIMIT. So this saves a lot of unnecessary work. This path is also very well covered by many tests - see test coverage is 100% for changed code. As for adding unit tests, we do have LuceneAnalyzerTest which covers ngrams but not ngrams and vector in the same query. I'll can add a test. |
What is the issue
Plan#optimize can take a very long time when given plans with thousands of intersected clauses, which can result from using ngram analyzers. Related issue: https://github.com/riptano/cndb/issues/10731.
What does this PR fix and why was it fixed
Fixes https://github.com/riptano/cndb/issues/11655
Checklist before you submit for review
NoSpamLogger
for log lines that may appear frequently in the logs