-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Fix information schema queries not being merged correctly #19138
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
Conversation
Signed-off-by: Arthur Schreiber <[email protected]>
Signed-off-by: Arthur Schreiber <[email protected]>
Signed-off-by: Arthur Schreiber <[email protected]>
Signed-off-by: Arthur Schreiber <[email protected]>
Signed-off-by: Arthur Schreiber <[email protected]>
Signed-off-by: Arthur Schreiber <[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
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #19138 +/- ##
=======================================
Coverage 69.88% 69.88%
=======================================
Files 1613 1613
Lines 216019 216055 +36
=======================================
+ Hits 150960 150999 +39
+ Misses 65059 65056 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
#19139 contains a better approach / fix. |
Description
Various queries against
information_schematables were not being merged correctly.This pull request contains multiple interlinked fixes:
Column offset map for
UNIONqueriesThe column offset map used for
UNIONqueries was doing column name comparisons incorrectly. The offset map was built using the user provided column names, but lowercased column names were used during lookups into the map. Column names in MySQL are case insensitive, so we now lowercase both the values used for creating the map as well as looking up the offsets.This affects not just
information_schemaUNIONqueries, but was noticed there because the schema forinformation_schematables that ships with Vitess uses upper cased column names.Add support for merging
UNIONqueries targetinginformation_schematablesJOINoperations againstinformation_schematables supported being merged if the LHS and RHS targeted the same data sources (e.g. if the same schemas or tables were queried). This logic was missing from theUNIONmerging implementation.Fix
information_schemamerge ability rules (affects bothJOINandUNIONmerging)Merging of
information_schemaroutes was only possible if the table schema list of the LHS and the RHS of the merge matched fully (exact match of all values). This was artificially limiting the routes that could be merged, as the actual requirement is that the table schema lists only need to intersect (share one common value).This also updated the planner debug output for DBA routes (used for
information_schemaqueries) to include theSysTableTableSchemaandSysTableTableNameinformation to make it a bit easier to understand what's going on.Related Issue(s)
Checklist
Deployment Notes
AI Disclosure