Skip to content

planner: TIDB_INLJ hint cannot take effect when left joining two sub-queries #46160

Closed
@qw4990

Description

Enhancement

create table t1 (a int, key(a));
create table t2 (a int, key(a));

explain select /*+ tidb_inlj(bb) */ aa.* from 
(select * from t1) as aa
left join 
(select t2.a, t2.a*2 as a2 from t2) as bb
on aa.a=bb.a;

mysql> show warnings;
+---------+------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                                                                          |
+---------+------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| Warning | 1815 | There are no matching table names for (bb) in optimizer hint /*+ INL_JOIN(bb) */ or /*+ TIDB_INLJ(bb) */. Maybe you can use the table alias name |
+---------+------+--------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

Metadata

Assignees

Labels

affects-6.5This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.epic/hintseverity/moderatesig/plannerSIG: Plannertype/bugThe issue is confirmed as a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions