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

inspect: remove redundant join conditions #699

Closed
wants to merge 2 commits into from

Conversation

twotwotwo
Copy link
Contributor

@twotwotwo twotwotwo commented Jan 22, 2019

Related issue: #698

Description

The TABLE_SCHEMA and TABLE_NAME in the INFORMATION_SCHEMA query in getCandidateUniqueKeys are already guaranteed to have the same value in COLUMNS and UNIQUES because of the WHEREs in each query. Dropping it from the ON clause makes it complete much faster.

On (at least) MySQL 5.6 installs with thousands of tables, this query completes in a few seconds without the additional join conditions, but takes more than a minute with it.

In case this PR introduced Go code changes:

  • contributed code is using same conventions as original code
  • script/cibuild returns with no formatting errors, build errors or unit test errors.

@shlomi-noach shlomi-noach self-assigned this Jan 23, 2019
@shlomi-noach shlomi-noach self-requested a review January 23, 2019 04:46
Copy link
Contributor

@shlomi-noach shlomi-noach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this makes sense, I'll send it to testing.

@shlomi-noach
Copy link
Contributor

closes #698

@shlomi-noach
Copy link
Contributor

implicitly merged via #701. Thank you!

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 this pull request may close these issues.

2 participants