-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.This bug affects the 8.1.x(LTS) versions.severity/moderatesig/plannerSIG: PlannerSIG: Plannertype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
CREATE TABLE t_employees (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
fname VARCHAR(25) NOT NULL,
lname VARCHAR(25) NOT NULL,
store_id INT NOT NULL,
department_id INT NOT NULL
);
alter table t_employees add index idx(department_id);
explain
with t as (select /*+ inl_join(e) */em.* from t_employees em join t_employees e where em.store_id=e.department_id )
select * from t ;
The hint is worked, but it has some wrong warnings.
2. What did you expect to see? (Required)
id |estRows |task |access object |operator info |
-----------------------+--------+---------+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
IndexJoin_16 |12500.00|root | |inner join, inner:IndexReader_15, outer key:test.t_employees.store_id, inner key:test.t_employees.department_id, equal cond:eq(test.t_employees.store_id, test.t_employees.department_id)|
├─TableReader_24(Build)|10000.00|root | |data:TableFullScan_23 |
│ └─TableFullScan_23 |10000.00|cop[tikv]|table:em |keep order:false, stats:pseudo |
└─IndexReader_15(Probe)|12500.00|root | |index:IndexRangeScan_14 |
└─IndexRangeScan_14 |12500.00|cop[tikv]|table:e, index:idx(department_id)|range: decided by [eq(test.t_employees.department_id, test.t_employees.store_id)], keep order:false, stats:pseudo |
the explain use index join without warnings.
3. What did you see instead (Required)
id |estRows |task |access object |operator info |
-----------------------+--------+---------+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
IndexJoin_16 |12500.00|root | |inner join, inner:IndexReader_15, outer key:test.t_employees.store_id, inner key:test.t_employees.department_id, equal cond:eq(test.t_employees.store_id, test.t_employees.department_id)|
├─TableReader_24(Build)|10000.00|root | |data:TableFullScan_23 |
│ └─TableFullScan_23 |10000.00|cop[tikv]|table:em |keep order:false, stats:pseudo |
└─IndexReader_15(Probe)|12500.00|root | |index:IndexRangeScan_14 |
└─IndexRangeScan_14 |12500.00|cop[tikv]|table:e, index:idx(department_id)|range: decided by [eq(test.t_employees.department_id, test.t_employees.store_id)], keep order:false, stats:pseudo |
the explain use index join with warnings
There are no matching table names for (e) in optimizer hint /*+ INL_JOIN(e, e) / or /+ TIDB_INLJ(e, e) */. Maybe you can use the table alias name
4. What is your TiDB version? (Required)
Release Version: v8.1.0
Edition: Community
Git Commit Hash: 945d07c
Git Branch: HEAD
UTC Build Time: 2024-05-21 03:51:57
GoVersion: go1.21.10
Race Enabled: false
Check Table Before Drop: false
Store: tikv
Metadata
Metadata
Assignees
Labels
affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.This bug affects the 8.1.x(LTS) versions.severity/moderatesig/plannerSIG: PlannerSIG: Plannertype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.