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

explain format='hint' doesn't work for IndexHashJoin / IndexMergeJoin #20991

Closed
eurekaka opened this issue Nov 11, 2020 · 1 comment · Fixed by #20992
Closed

explain format='hint' doesn't work for IndexHashJoin / IndexMergeJoin #20991

eurekaka opened this issue Nov 11, 2020 · 1 comment · Fixed by #20992
Assignees
Labels
Milestone

Comments

@eurekaka
Copy link
Contributor

Development Task

mysql> create table t1(a int, b int, c int, key(b), key(c));
Query OK, 0 rows affected (0.01 sec)

mysql> create table t2 like t1;
Query OK, 0 rows affected (0.00 sec)

mysql> explain format='hint' select /*+ inl_merge_join(t2) */ * from t1 inner join t2 on t1.b = t2.b and t1.c = 1;
+--------------------------------------------------------------------------------------------+
| hint                                                                                       |
+--------------------------------------------------------------------------------------------+
| use_index(@`sel_1` `test`.`t1` `c`), use_index(@`sel_1` `test`.`t2` `b`), inl_merge_join() |
+--------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> explain format='hint' select /*+ inl_hash_join(t2) */ * from t1 inner join t2 on t1.b = t2.b and t1.c = 1;
+---------------------------------------------------------------------------------------------------------------------+
| hint                                                                                                                |
+---------------------------------------------------------------------------------------------------------------------+
| use_index(@`sel_1` `test`.`t1` `c`), use_index(@`sel_1` `test`.`t2` `b`), inl_hash_join(@`sel_1` ), inl_hash_join() |
+---------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

The generated inl_hash_join() / inl_merge_join() hint would not take effect since they have no table parameters.

@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

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

Successfully merging a pull request may close this issue.

4 participants