-
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
Avoid rewriting unsharded queries and split semantic analysis in two #15217
Conversation
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
|
Signed-off-by: Andres Taylor <andres@planetscale.com>
c7c7536
to
b51d049
Compare
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Do we need to backport this to 18 and 19? |
unit test are failing |
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #15217 +/- ##
========================================
Coverage 67.43% 67.44%
========================================
Files 1560 1560
Lines 192789 192899 +110
========================================
+ Hits 130014 130099 +85
- Misses 62775 62800 +25 ☔ View full report in Codecov by Sentry. |
7434e1f
to
f44bfce
Compare
…15217) Signed-off-by: Andres Taylor <andres@planetscale.com> Co-authored-by: Andres Taylor <andres@planetscale.com> Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
There is still an issue with the routing
This is being sent to the wrong keyspace |
This hasn't changed with this PR. The same thing happens on |
…15217) Signed-off-by: Andres Taylor <andres@planetscale.com>
Description
In a recent PR, we introduced a column alias expansion that has lead to a few users running into issues.
The idea with the column expansion was to make everything cleaner and simpler for the planner. In the cases where the planner was not involved (queries to a single unsharded keyspace), this however lead to problems.
With this PR, we change the semantic analysis and the early rewriter so that we do minimal work on the query when we don't need it.
In the early phase of the analyzer, we go over tables in FROM clauses, and see if any of them needs additional planning. If after this step we know that we don't need to plan the query, we are done and finish early, bypassing a lot of steps that are not necessary.
Related Issue(s)
PR that introduced the bug: #14935
Checklist
Deployment Notes