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

inl_hash_join does not work as expected #15318

Closed
XuHuaiyu opened this issue Mar 12, 2020 · 0 comments · Fixed by #15319
Closed

inl_hash_join does not work as expected #15318

XuHuaiyu opened this issue Mar 12, 2020 · 0 comments · Fixed by #15319
Assignees
Labels
severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@XuHuaiyu
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
tidb> use test

tidb> create table t1(a int, index(a));
Query OK, 0 rows affected (0.01 sec)

tidb> create table t2(a int, index(a));
Query OK, 0 rows affected (0.01 sec)

tidb> use test2

tidb> desc select /*+ inl_hash_join(test.t1) */ * from test.t1 join test.t2 on test.t1.a = test.t2.a;
+-----------------------------+----------+-----------+-----------------------------------------------------+
| id                          | estRows  | task      | operator info                                       |
+-----------------------------+----------+-----------+-----------------------------------------------------+
| MergeJoin_7                 | 12487.50 | root      | inner join, left key:test.t1.a, right key:test.t2.a |
| ├─IndexReader_35(Build)     | 9990.00  | root      | index:IndexFullScan_34                              |
| │ └─IndexFullScan_34        | 9990.00  | cop[tikv] | table:t2, index:a, keep order:true, stats:pseudo    |
| └─IndexReader_33(Probe)     | 9990.00  | root      | index:IndexFullScan_32                              |
|   └─IndexFullScan_32        | 9990.00  | cop[tikv] | table:t1, index:a, keep order:true, stats:pseudo    |
+-----------------------------+----------+-----------+-----------------------------------------------------+
5 rows in set, 1 warning (0.00 sec)

tidb> show warnings;
+---------+------+-------------------------------------------------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                                                       |
+---------+------+-------------------------------------------------------------------------------------------------------------------------------+
| Warning | 1815 | There are no matching table names for (t1) in optimizer hint /*+ INL_HASH_JOIN(t1) */. Maybe you can use the table alias name |
+---------+------+-------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
  1. What did you expect to see?
    indexHashJoin can be chosen forcibly

  2. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?

Release Version: v4.0.0-beta-345-gf51a7fc6e
Git Commit Hash: f51a7fc6e9b24fc0c0eb1ecb6da2e67ad8a34be4
Git Branch: master
UTC Build Time: 2020-03-12 06:26:29
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants