-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
expression rewriting: enable more rewrites and limit CNF rewrites #14560
Conversation
Signed-off-by: Andres Taylor <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
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.
Tests are failing, otherwise looks good to me.
Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
Something is off in the rewritten queries.
@@ -4110,7 +4110,7 @@ | |||
"Sharded": true | |||
}, | |||
"FieldQuery": "select id from `user` where 1 != 1", | |||
"Query": "select id from `user` where id = 5 and `name` = 'foo' or id = 12 and `name` = 'bar'", | |||
"Query": "select id from `user` where id in ::__vals and (id = 5 or `name` = 'bar') and (`name` = 'foo' or id = 12) and `name` in ('foo', 'bar')", |
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.
Sorry i had a doubt about this re-written query but turns out it looks good to me!
Signed-off-by: Florent Poinsard <[email protected]>
…4560) Co-authored-by: Florent Poinsard <[email protected]>
…4560) Co-authored-by: Florent Poinsard <[email protected]>
…4560) Co-authored-by: Florent Poinsard <[email protected]>
…NF rewrites (#14560) (#14576) Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Florent Poinsard <[email protected]>
…NF rewrites (#14560) (#14575) Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Florent Poinsard <[email protected]>
…NF rewrites (#14560) (#14574) Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Florent Poinsard <[email protected]>
…tessio#14560) Co-authored-by: Florent Poinsard <[email protected]>
Description
When we can't find a good vindex to use, we try rewriting the WHERE clause into CNF (conjuctive normal form), and this transformation can in the worst case become an exponentially large expression. To stop this from happening, we count the number of
OR
expression we are dealing to stop the worst case from happening.Related Issue(s)
Checklist