Skip to content

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

@wangzihuacool

Description

@wangzihuacool

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions