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

force index in Iteration Range End Value queries to fix execution plans #1242

Closed
wangzihuacool opened this issue Jan 6, 2023 · 4 comments
Closed

Comments

@wangzihuacool
Copy link
Contributor

I recently found that gh-ost occasionally executes slowly in MySQL 8.0.
When copying data to the _gho table, querys for Iteration Range End Values occationally use the wrong index due to inappropriate optimizer selection.

I think we can force the unique-key index to avoid inappropriate optimizer selection, in BuildUniqueKeyRangeEndPreparedQueryViaOffset and BuildUniqueKeyRangeEndPreparedQueryViaTemptable. Just like unique key range queries do in #1237 .

I'd like to contribute the patch, if you agree.

@timvaillancourt
Copy link
Collaborator

timvaillancourt commented Jan 6, 2023

@wangzihuacool thanks for this report. I believe #1237 will resolve this issue, can you please confirm?

@timvaillancourt
Copy link
Collaborator

timvaillancourt commented Jan 6, 2023

in BuildUniqueKeyRangeEndPreparedQueryViaOffset and BuildUniqueKeyRangeEndPreparedQueryViaTemptable

@wangzihuacool sorry I misread your issue summary, this is similar but different to #1237 as you mentioned 👍

I'd like to contribute the patch, if you agree.

A PR would be appreciated thanks!

@wangzihuacool
Copy link
Contributor Author

I have created a PR #1245 , hope you take the time to review it.

@timvaillancourt timvaillancourt linked a pull request Jan 11, 2023 that will close this issue
@timvaillancourt
Copy link
Collaborator

@wangzihuacool I believe this is resolved by #1237. Please test and re-open if this is not the case. Thanks!

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

Successfully merging a pull request may close this issue.

2 participants