Skip to content
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

Delegate Column Availability Checks to MySQL When Possible #17083

Closed
systay opened this issue Oct 28, 2024 · 0 comments · Fixed by #17077
Closed

Delegate Column Availability Checks to MySQL When Possible #17083

systay opened this issue Oct 28, 2024 · 0 comments · Fixed by #17077

Comments

@systay
Copy link
Collaborator

systay commented Oct 28, 2024

When a query can be routed to a single shard and sent directly to MySQL, column availability checks should be deferred to MySQL rather than resulting in an error at the vtgate planner.

Example:

select foo, bar 
from user u, user_extra ue 
where u.id = ue.user_id

Problem:

If vtgate is running without schema tracking, it may be unable to determine the tables to which columns like foo and bar belong, resulting in an ambiguous column error. However, because this query can be merged into a single route based on sharding key choices, it is unnecessary to perform these column checks at the vtgate level. Instead, we can rely on MySQL to handle column validation and return a meaningful error if any issues are found.

Proposed Solution:

Skip vtgate column validation for queries routed to a single shard and let MySQL manage column availability checks to avoid redundant errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant